We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Subject code here – in usual case, we wait for the signal of new event. But it may happen that all events are back in the pool before the Wait call.
This test can reproduce this beheivior:
func TestDeadLock(t *testing.T) { const ( poolCapacity = 32 concurrency = 64 ) pool := newEventPool(poolCapacity, DefaultAvgInputEventSize) for i := 0; i < 100_000; i++ { fmt.Println("new test iteration", i) wg := new(sync.WaitGroup) wg.Add(concurrency) for i := 0; i < concurrency; i++ { go func() { defer wg.Done() e := pool.get() runtime.Gosched() pool.back(e) }() } wg.Wait() } }
Solution: We have to run a goroutine that will force the Broadcast/Signal every timer tick. I'll send PR by the end of the week.
The text was updated successfully, but these errors were encountered:
Successfully merging a pull request may close this issue.
Subject code here – in usual case, we wait for the signal of new event. But it may happen that all events are back in the pool before the Wait call.
This test can reproduce this beheivior:
Solution:
We have to run a goroutine that will force the Broadcast/Signal every timer tick. I'll send PR by the end of the week.
The text was updated successfully, but these errors were encountered: