rigtorp / MPMCQueue

A bounded multi-producer multi-consumer concurrent queue written in C++11
MIT License
1.15k stars 159 forks source link

use of compare_exchange_weak #47

Open Philippe91 opened 4 months ago

Philippe91 commented 4 months ago

Both for enqueing and dequeing, why not using compare_exchange_weak / std::memory_order_relaxed (instead of compare_exchange_strong / memory_order_seq_cst) like in Dmitry Vyukov latest implementation (2021)? This seems to make sense, as we are in a loop.

https://drive.google.com/file/d/1uCefvM3bTnWLFrcYoMxCOKGjWwHJQM2n/view

rigtorp commented 4 months ago

yes I haven't optimized for ARM. Ideally there should only be single dmb barrier.

On Sun, Mar 3, 2024 at 4:45 AM Philippe91 @.***> wrote:

Both for enqueing and dequeing, why not using compare_exchange_weak / std::memory_order_relaxed (instead of compare_exchange_strong / memory_order_seq_cst) like in Dmitry Vyukov latest implementation (2021)? This seems to make sense, as we are in a loop.

https://drive.google.com/file/d/1uCefvM3bTnWLFrcYoMxCOKGjWwHJQM2n/view

— Reply to this email directly, view it on GitHub https://github.com/rigtorp/MPMCQueue/issues/47, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABLO26XK2ULP3NUR6OGTC3YWL5LPAVCNFSM6AAAAABED3KMFCVHI2DSMVQWIX3LMV43ASLTON2WKOZSGE3DKMRZGY4DKNY . You are receiving this because you are subscribed to this thread.Message ID: @.***>