Skip to content

why idle-queue use std::mutex, not use strategized Lock as golang? #6291

Answered by Darksonn
sxstd001 asked this question in Q&A
Discussion options

You must be logged in to vote

The reason is that nobody has provided a really good justification for why we should do something else. The standard mutex is the default choice, and using the standard mutex (which is not always std::sync::Mutex in Tokio, due to the parking_lot flag) should always be preferred over a bespoke custom mutex implementation unless there is a really good justification for it.

Also, I don't know which queue you are referring to. We don't have a queue of idle tasks.

Next time you ask a question, you should provide much more information. For this question, it would have been appropriate to:

  1. Include a direct link to the code in Tokio.
  2. Include a direct link to the code in the Go runtime.
  3. Include a…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@sxstd001
Comment options

@Darksonn
Comment options

Answer selected by sxstd001
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants