What is the ideal data structure to send task/data between the async context and a dedicated thread? #6522
Answered
by
Darksonn
byte-sourcerer
asked this question in
Q&A
-
I read the blog Async: What is blocking?, which advocates the concept of employing a long running dedicated thread to handle blocking task. Consequently, this prompts the question - what would be the ideal data structure for passing tasks or data to the long running dedicated thread? I have the following options:
|
Beta Was this translation helpful? Give feedback.
Answered by
Darksonn
Apr 30, 2024
Replies: 1 comment
-
I would generally recommend using things from |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
byte-sourcerer
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I would generally recommend using things from
tokio::sync
unless you have a good reason not to. So in this case, I recommendtokio::sync::mpsc
over some other mpsc channel.