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
They are public methods, the caller may call them at some unknown state, so it's the container's responsibility to behave correctly under any condition. The best way is return a bool indicate failure or success, instead of throw assertion exception (and only in debug mode).
The reference implementation in C++ used this returning bool policy too:
https://github.com/MartinNowak/lock-free/blob/master/src/lock_free/rwqueue.d#L29
https://github.com/MartinNowak/lock-free/blob/master/src/lock_free/rwqueue.d#L38
They are public methods, the caller may call them at some unknown state, so it's the container's responsibility to behave correctly under any condition. The best way is return a bool indicate failure or success, instead of throw assertion exception (and only in debug mode).
The reference implementation in C++ used this returning bool policy too:
https://bitbucket.org/KjellKod/lock-free-wait-free-circularfifo/src/1dcdaa20158c69f280c64dc0a0f9b11f45983a29/src/circularfifo_memory_sequential_consistent.hpp#lines-65
https://bitbucket.org/KjellKod/lock-free-wait-free-circularfifo/src/1dcdaa20158c69f280c64dc0a0f9b11f45983a29/src/circularfifo_memory_sequential_consistent.hpp#lines-75
The text was updated successfully, but these errors were encountered: