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

Remove wrong advice about spin locks from spin_loop_hint docs #67798

Merged
merged 2 commits into from
Jan 8, 2020

Commits on Jan 2, 2020

  1. Remove wrong advice about spin locks from spin_loop_hint docs

    Using a pure spin lock for a critical section in a preemptable thread
    is always wrong, however short the critical section may be. The thread
    might be preempted, which will cause all other threads to hammer
    busily at the core for the whole quant. Moreover, if threads have
    different priorities, this might lead to a priority inversion problem
    and a deadlock. More generally, a spinlock is not more efficient than
    a well-written mutex, which typically does several spin iterations at
    the start anyway.
    
    The advise about UP vs SMP is also irrelevant in the context of
    preemptive threads.
    matklad committed Jan 2, 2020
    Configuration menu
    Copy the full SHA
    4d04b0b View commit details
    Browse the repository at this point in the history

Commits on Jan 5, 2020

  1. Configuration menu
    Copy the full SHA
    b25eeef View commit details
    Browse the repository at this point in the history