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

<mutex>: Further improve call_once performance by using atomic CAS and WaitOnAddress #707

Open
AlexGuteniev opened this issue Apr 11, 2020 · 0 comments
Labels
performance Must go faster vNext Breaks binary compatibility

Comments

@AlexGuteniev
Copy link
Contributor

AlexGuteniev commented Apr 11, 2020

More aggressive in direction of #606

Call once on atomic operations, directly in header, something like what currently call_once XP fallback is, but doing std::atomic<char>::wait instead of continuous spinning.

(std::atomic<char>::wait will spin a bit by itself before going to kernel wait, either inside WaitOnAddress or in a fallback)

So fast path is header only and fully inlined into caller.

ODR-breaking, since stopping using INIT_ONCE structure.

vNext note: Resolving this issue will require breaking binary compatibility. We won't be able to accept pull requests for this issue until the vNext branch is available. See #169 for more information.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
performance Must go faster vNext Breaks binary compatibility
Projects
None yet
Development

No branches or pull requests

2 participants