Skip to content

Memory ordering guarantees across .await points? #4484

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

You must be logged in to vote

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.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by ZhennanWu
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