You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In lf_queueu.h, the following function might not be thread-safe because the updateWriteIdx() is called after calling getNextToWriteTo()
auto getNextToWriteTo() noexcept {
return &store_[next_write_index_];
}
This might lead to two threads accessing the same write location. The same thing applies to reads as well. Let me know if there is anything wrong with my understanding. Should we use a CAS-based lock-free queue, however, it will have to spin. Or we should atomically increment the next_write_index_ with modulus.
The text was updated successfully, but these errors were encountered:
In lf_queueu.h, the following function might not be thread-safe because the
updateWriteIdx()
is called after callinggetNextToWriteTo()
This might lead to two threads accessing the same write location. The same thing applies to reads as well. Let me know if there is anything wrong with my understanding. Should we use a CAS-based lock-free queue, however, it will have to spin. Or we should atomically increment the
next_write_index_
with modulus.The text was updated successfully, but these errors were encountered: