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

backoff: remove global rand.Seed and using locked rand.Rand #19

Merged
merged 6 commits into from
Dec 14, 2022

Conversation

zchee
Copy link
Contributor

@zchee zchee commented Dec 11, 2022

rand.Seed will affect globally. Remove it, and implements mutex locked rand.Rand similar of stdlib.

@sethvargo
Copy link
Owner

What's the reason for the mutex?

@zchee
Copy link
Contributor Author

zchee commented Dec 12, 2022

@zchee
Copy link
Contributor Author

zchee commented Dec 12, 2022

Q: Should I use a global variable similar to stdlib globalRand?


implemented

@zchee zchee force-pushed the avoid-global-seed branch 4 times, most recently from d6236a4 to dc94ec5 Compare December 12, 2022 04:32
Signed-off-by: Koichi Shiraishi <[email protected]>
- lockedSource struct with 16 pointer bytes could be 8

Signed-off-by: Koichi Shiraishi <[email protected]>
rand.go Outdated Show resolved Hide resolved
rand.go Show resolved Hide resolved
rand.go Outdated Show resolved Hide resolved
rand.go Show resolved Hide resolved
@zchee
Copy link
Contributor Author

zchee commented Dec 14, 2022

@sethvargo PTAL

@zchee zchee requested a review from sethvargo December 14, 2022 13:03
@sethvargo sethvargo merged commit 9eb639b into sethvargo:main Dec 14, 2022
@zchee zchee deleted the avoid-global-seed branch December 14, 2022 13:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants