Skip to content

[Solved] Help: Atomic operation goes wrong in this situation #5641

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

You must be logged in to vote

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.

Replies: 1 comment 7 replies

Comment options

You must be logged in to vote
7 replies
@Darksonn
Comment options

@kingwingfly
Comment options

@Darksonn
Comment options

@Darksonn
Comment options

@kingwingfly
Comment options

Answer selected by hawkw
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
C-question User questions that are neither feature requests nor bug reports A-tokio Area: The main tokio crate
2 participants
Converted from issue

This discussion was converted from issue #5640 on April 20, 2023 21:03.