eclipse-iceoryx/iceoryx

Wrong memory order in MpmcLoFFLi fence synchronization

Closed this issue · 0 comments

Brief feature description

The MpmcLoFFLi uses a fence to synchronize m_nextFreeIndex between pop and push operations but the push operation has the wrong memory order. It should be memory_order_acquire but probably due to a copy&paste error it is memory_order_release.

While this breaks MpmcLoFFLi the issue has no effect on the usage in iceoryx since the indices are implicitly synchronized when they are transferred to another thread. It would only be an issue if the mechanism to transfer the index would be done via a relaxed store on an atomic in one thread and a relaxed load in another thread. Nevertheless, the issue should be fixed.