max0x7ba / atomic_queue

C++ lockless queue.
MIT License
1.47k stars 176 forks source link

'optimist atomic queue' description is something different in read.md #50

Closed jony999999 closed 1 year ago

jony999999 commented 1 year ago

In your bench code(benchmarks.cc), Just 'AtomicQueue/AtomicQueue' is defined with retryDecorator (i.e. busy-waits). and Optimist alias is not defined with retryDecorator.

max0x7ba commented 1 year ago

In your bench code(benchmarks.cc), Just 'AtomicQueue/AtomicQueue' is defined with retryDecorator (i.e. busy-waits). and Optimist alias is not defined with retryDecorator.

Correct. And..?

jony999999 commented 1 year ago

readme.md decribes blow,

Available containers are: AtomicQueue - a fixed size ring-buffer for atomic elements. OptimistAtomicQueue - a faster fixed size ring-buffer for atomic elements which busy-waits when empty or full. AtomicQueue2 - a fixed size ring-buffer for non-atomic elements. OptimistAtomicQueue2 - a faster fixed size ring-buffer for non-atomic elements which busy-waits when empty or full.

max0x7ba commented 1 year ago

In your bench code(benchmarks.cc), Just 'AtomicQueue/AtomicQueue' is defined with retryDecorator (i.e. busy-waits). and Optimist alias is not defined with retryDecorator.

OptimistAtomicQueue2 - a faster fixed size ring-buffer for non-atomic elements which busy-waits when empty or full.

I believe documentation covers your question in https://github.com/max0x7ba/atomic_queue#api in paragraph starting with "Note that optimism ..."