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

Change memory ordering in System wrapper example #106599

Merged
merged 1 commit into from
Apr 27, 2023

Commits on Jan 8, 2023

  1. Change memory ordering in System wrapper example

    Currently, the `SeqCst` ordering is used, which seems unnecessary:
    + Even `Relaxed` ordering guarantees that all updates are atomic and are executed in total order
    + User code only reads atomic for monitoring purposes, no "happens-before" relationships with actual allocations and deallocations are needed for this
    
    If argumentation above is correct, I propose changing ordering to `Relaxed` to clarify that no synchronization is required here, and improve performance (if somebody copy-pastes this example into their code).
    MikailBag authored Jan 8, 2023
    Configuration menu
    Copy the full SHA
    7b9f644 View commit details
    Browse the repository at this point in the history