smarty-prototypes / go-disruptor

A port of the LMAX Disruptor to the Go language.
Apache License 2.0
1.37k stars 212 forks source link

About 'SharedWriter.Reserve' parameter 'count' #4

Closed XieXiaomei-ptr closed 6 years ago

XieXiaomei-ptr commented 6 years ago

I found in your example benchmark-disruptor 'ReserveMany' that Reserve's parameter used a value of 16. Whether or not to use ReserveMany, its parameters 'count' must be a power of 2?

joliver commented 6 years ago

@XieXiaomei-ptr No. Reserve can be any number you want up to the size of the buffer.