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

Make pipeline.NextRound atomic #140

Open
tzaffi opened this issue Aug 17, 2023 · 0 comments
Open

Make pipeline.NextRound atomic #140

tzaffi opened this issue Aug 17, 2023 · 0 comments

Comments

@tzaffi
Copy link
Contributor

tzaffi commented Aug 17, 2023

Problem

The pipeline's NextRound is updated at the end of every round but accessed in several contexts that could be running in go-routines. A workaround we use atomic.LoadUint64 but that is no longer considered a best practice.

Solution

Consider using pipeline.NextRound.Load() and similar functions for updating the variable.

Caveat Emptor

This exact approach may not be backwards compatible on some 32-bit systems: https://go101.org/article/memory-layout.html

Dependencies

Should wait until #128 is merged

Urgency

Low

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

No branches or pull requests

2 participants