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: add more randomization to Pool with race detector #52360

Open
dsnet opened this issue Apr 14, 2022 · 1 comment
Open

sync: add more randomization to Pool with race detector #52360

dsnet opened this issue Apr 14, 2022 · 1 comment
Labels
FeatureRequest NeedsInvestigation RaceDetector
Milestone

Comments

@dsnet
Copy link
Member

@dsnet dsnet commented Apr 14, 2022

sync.Pool is an easy data structure to use incorrectly.

Currently the Pool randomly drops items in race mode.
We should add additional non-determinism such as:

  • For the per-processor cache, randomly select an element (rather always taking the head).
  • Randomly steal from a different processor's cache.

This will slow down the implementation, but the point of race is to detect bugs, not have the best performance.

@dmitshur dmitshur added FeatureRequest RaceDetector NeedsInvestigation labels Apr 14, 2022
@dmitshur dmitshur added this to the Backlog milestone Apr 14, 2022
@dmitshur
Copy link
Contributor

@dmitshur dmitshur commented Apr 14, 2022

CC @golang/runtime.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
FeatureRequest NeedsInvestigation RaceDetector
Projects
None yet
Development

No branches or pull requests

2 participants