3 ms·
I've spent an hour or two looking more closely at the pointer/counter ordering behaviour in the queue. I'm going to go out a bit on a limb (this is mental code
by liblfds_admin 14y ago
I've spent an hour or two looking more closely at the pointer/counter ordering behaviour in the queue. I'm going to go out a bit on a limb (this is mental code inspection only) and say it's not in fact a problem. It IS a problem in a stack which increments the counter only on push, but it's NOT a problem in the M&S queue because of the checking logic which follows the pointer/counter read. If there has been a torn read, where the pointer and counter don't match, then the main loop will simply iterate and retry, because the counter doesn't match; and it's being incremented on queue and dequeue.