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

sync: consider doing active spinning #8889

Closed
dvyukov opened this issue Oct 7, 2014 · 0 comments
Closed

sync: consider doing active spinning #8889

dvyukov opened this issue Oct 7, 2014 · 0 comments

Comments

@dvyukov
Copy link
Member

dvyukov commented Oct 7, 2014

Currently sync synchronization primitives are fully cooperative. That is, once
contention is discovered, the goroutine calls into scheduler. This is suboptimal as the
resource can become free soon after.
Consider adding limited active spinning on contention with scheduler hint. The scheduler
hint can include:
1. If GOMAXPROCS==1, don't spin (pointless)
2. If local work queue is not empty, don't spin (at least we have local work, so cycles
won't be wasted)
Otherwise spin for a bit, re-check resource and block if still busy.
@golang golang locked and limited conversation to collaborators Jun 25, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants