[Solved] Help: Atomic operation goes wrong in this situation #5641
Answered
by
Darksonn
kingwingfly
asked this question in
Q&A
-
Beta Was this translation helpful? Give feedback.
Answered by
Darksonn
Apr 20, 2023
Replies: 1 comment 7 replies
-
This is because you are blocking the thread. One of the tasks you spawned was scheduled to run next on the current thread (via the LIFO slot), and the other tasks were sent to other worker threads in the runtime. Since your task never yields, the task in the LIFO slot is never scheduled, meaning that it's add is not seen when the timeout triggers. |
Beta Was this translation helpful? Give feedback.
7 replies
Answer selected by
hawkw
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is because you are blocking the thread. One of the tasks you spawned was scheduled to run next on the current thread (via the LIFO slot), and the other tasks were sent to other worker threads in the runtime. Since your task never yields, the task in the LIFO slot is never scheduled, meaning that it's add is not seen when the timeout triggers.