-
Notifications
You must be signed in to change notification settings - Fork 178
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
timing wheel data race #12
Comments
Thank you @wllenyj Do you think what is the best way to fix it? Maybe Lock? |
w.tv1[index] = make([]*timer, 0, defaultTimerSize) or var pool = &sync.Pool{
New: func() interface{} {
return make([]*timer, 0, defaultTimerSize)
},
} w.tv1[index] = pool.Get().([]*timer) f := func(vec []*timer) {
//.....
vec = vec[0:0: defaultTimerSize]
pool.Put(vec)
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
go/time2/wheel.go
Line 148 in 2b7082d
go/time2/wheel.go
Line 154 in 2b7082d
go/time2/wheel.go
Line 112 in 2b7082d
The text was updated successfully, but these errors were encountered: