MPMCQueue icon indicating copy to clipboard operation
MPMCQueue copied to clipboard

use of compare_exchange_weak

Open Philippe91 opened this issue 1 year ago • 1 comments

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

Philippe91 avatar Mar 03 '24 10:03 Philippe91

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: @.***>

rigtorp avatar Mar 06 '24 04:03 rigtorp