-
Notifications
You must be signed in to change notification settings - Fork 207
Description
Hello @max0x7ba ,
I have three issues about atomic_queue.
Firstly, i could not find in the documentation, but i assume that the queues with atomic::is_always_lock_free (Atomic_Queue and Atomic_QueueB) shall be used with caution such that these queues use a NIL sentinel (T{}). T{} shall not be pushed to these queues as it represents the empty state. I think this should be documented clearly.
The 2nd one is related to replacing the modulo (index % size_) with a bit mask (index & (size_ - 1)) during the index determination which you already mentioned in another issue and already applied to the queues recieving the size parameter. I can apply this modification to the statically sized queues with a PR.
The last one is about the branch prediction annotations missed within the try_ versions of push and pop. i think, the inspections for FULL/EMPTY queue could be annotated UNLIKELY.
If these three points make sense to you, I can prepare a documentation PR for the 1st issue and two PRs for the remaining two.