-
Notifications
You must be signed in to change notification settings - Fork 212
-
Notifications
You must be signed in to change notification settings - Fork 212
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
Is go-disruptor support many producer? #9
Comments
The way I use it cause data race.
And the func (this *DefaultWriter) Reserve(count int64) int64 {
if count <= 0 {
panic(ErrMinimumReservationSize)
}
this.previous += count
for spin := int64(0); this.previous-this.capacity > this.gate; spin++ {
if spin&SpinMask == 0 {
runtime.Gosched() // LockSupport.parkNanos(1L); http://bit.ly/1xiDINZ
}
this.gate = this.upstream.Load()
}
return this.previous
} |
Right now it only supports a single producer. If you want to do multiple producers, the only workaround is to do:
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The example/main.go shows how to use go-disruptor when only have a producer.
How could I use go-disruptor to support many producer?
I try to use it like the code below, but the test blocked. It seems that many procuder needs many writers?
The text was updated successfully, but these errors were encountered: