Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[docs] Improve Mutex FIFO explanation #3615

Merged
merged 1 commit into from Mar 12, 2021

Conversation

setpill
Copy link
Contributor

@setpill setpill commented Mar 12, 2021

Motivation

Fixes #3614

Solution

Expand example code to demonstrate ordering mechanism, and edit explanation where needed.

@Darksonn Darksonn added A-tokio Area: The main tokio crate M-sync Module: tokio/sync T-docs Topic: documentation labels Mar 12, 2021
Comment on lines 104 to +106
/// each thread goes to the back of the line after it increments the value once.
/// Note that there's some unpredictability to the timing between when the
/// threads are started, but once they are going they alternate predictably.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Strictly speaking this is not enforced by the above since a thread may for some reason spend a lot of type going from the unlock to starting the next lock, but I think this is fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-tokio Area: The main tokio crate M-sync Module: tokio/sync T-docs Topic: documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[docs] Mutex Example section: FIFO ordering explanation wrong
2 participants