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

Relax SeqCst ordering in standard library. #122729

Merged
merged 16 commits into from
Mar 21, 2024
Merged

Relax SeqCst ordering in standard library. #122729

merged 16 commits into from
Mar 21, 2024

Commits on Mar 19, 2024

  1. SeqCst->Relaxed in doc examples.

    SeqCst is unnecessary here.
    m-ou-se committed Mar 19, 2024
    Configuration menu
    Copy the full SHA
    a2c74b8 View commit details
    Browse the repository at this point in the history
  2. SeqCst->Relaxed in panic_unwind/emcc.

    SeqCst is unnecessary here.
    m-ou-se committed Mar 19, 2024
    Configuration menu
    Copy the full SHA
    5e4cc6f View commit details
    Browse the repository at this point in the history
  3. SeqCst->Relaxed for proc_macro bridge counter.

    Relaxed is enough here.
    m-ou-se committed Mar 19, 2024
    Configuration menu
    Copy the full SHA
    bf3debe View commit details
    Browse the repository at this point in the history
  4. SeqCst->{Release,Acquire} for alloc error hook.

    SeqCst is unnecessary.
    m-ou-se committed Mar 19, 2024
    Configuration menu
    Copy the full SHA
    904fef0 View commit details
    Browse the repository at this point in the history
  5. SeqCst->Relaxed for FIRST_PANIC.

    Relaxed is enough to make sure this `swap` results in `true` only once.
    m-ou-se committed Mar 19, 2024
    Configuration menu
    Copy the full SHA
    9f25a04 View commit details
    Browse the repository at this point in the history
  6. SeqCst->{Release,Acquire} in xous mutex.

    No need for SeqCst. Release+Acquire is the right memory ordering for a
    mutex.
    m-ou-se committed Mar 19, 2024
    Configuration menu
    Copy the full SHA
    eb96698 View commit details
    Browse the repository at this point in the history
  7. Use less restricted memory ordering in thread_parking::pthread.

    SeqCst is unnecessary here.
    m-ou-se committed Mar 19, 2024
    Configuration menu
    Copy the full SHA
    516684c View commit details
    Browse the repository at this point in the history
  8. SeqCst->{Release,Acquire} in sys_common::thread_local_key.

    SeqCst is unnecessary here.
    m-ou-se committed Mar 19, 2024
    Configuration menu
    Copy the full SHA
    e43aef0 View commit details
    Browse the repository at this point in the history
  9. SeqCst->{Release,Acquire} for wasm DropLock.

    SeqCst is unnecessary. Release+Acquire is the right ordering for a
    mutex.
    m-ou-se committed Mar 19, 2024
    Configuration menu
    Copy the full SHA
    46bb073 View commit details
    Browse the repository at this point in the history
  10. SeqCst->Relaxed in pal::windows::pipe.

    Relaxed is enough to ensure fetch_add(1) returns each integer exactly
    once.
    m-ou-se committed Mar 19, 2024
    Configuration menu
    Copy the full SHA
    60ad490 View commit details
    Browse the repository at this point in the history
  11. SeqCst->{Release,Acquire} for xous DropLock.

    SeqCst is unnecessary. Release+Acquire is the right ordering for a
    mutex.
    m-ou-se committed Mar 19, 2024
    Configuration menu
    Copy the full SHA
    69a4d77 View commit details
    Browse the repository at this point in the history
  12. SeqCst->Relaxed for xous set_nonblocking.

    The SeqCst wasn't synchronizing with anything. Relaxed is enough.
    m-ou-se committed Mar 19, 2024
    Configuration menu
    Copy the full SHA
    5a594f7 View commit details
    Browse the repository at this point in the history

Commits on Mar 20, 2024

  1. Use less restricted memory ordering in xous::thread_local_key.

    SeqCst isn't necessary in any of these cases.
    m-ou-se committed Mar 20, 2024
    Configuration menu
    Copy the full SHA
    8b519f9 View commit details
    Browse the repository at this point in the history
  2. SeqCst->Relaxed in std::net::test.

    Relaxed is enough to have fetch_add(1) return each value only once
    (until it wraps around).
    m-ou-se committed Mar 20, 2024
    Configuration menu
    Copy the full SHA
    b45a725 View commit details
    Browse the repository at this point in the history
  3. SeqCst->Relaxed in thread local test.

    Relaxed memory ordering is fine because spawn()/join() already provides
    all the synchronization we need.
    m-ou-se committed Mar 20, 2024
    Configuration menu
    Copy the full SHA
    acddc55 View commit details
    Browse the repository at this point in the history
  4. SeqCst->Relaxed in condvar test.

    Relaxed is enough here. Synchronization is done by the mutex.
    m-ou-se committed Mar 20, 2024
    Configuration menu
    Copy the full SHA
    3462175 View commit details
    Browse the repository at this point in the history