-
This issue is related to this StackOverflow question: https://stackoverflow.com/questions/70984928/rust-async-executor-memory-ordering-guarantees-when-moving-tasks-across-threads In tokio, tasks can be moved across threads at A more formal description of the StackOverflow question:
I'm not familiar with tokio's internal scheduler. If anyone can describe what kind of synchronization operations they perform when they move/poll a task, that would help a lot. C++ memory ordering spec: https://en.cppreference.com/w/cpp/atomic/memory_order In fact, there is also another different but related question. What is the memory ordering at a |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
When the task is moved from one thread to another, there is a The relation is not a |
Beta Was this translation helpful? Give feedback.
When the task is moved from one thread to another, there is a
synchronizes-with
relation between the things before and after the.await
. Depending on the exact circumstances, the synchronization comes from a mutex or an atomic using acquire & release semantics.The relation is not a
sequenced-before
relation because that relation only applies within a single thread.