3 ms·
This is actually a great analogy because it exemplifies the misconceptions people have about lockless queues. In the example with multiple counters, in real li
by SUPERCILEX 1y ago
This is actually a great analogy because it exemplifies the misconceptions people have about lockless queues.
In the example with multiple counters, in real life each counter could shout out a number and have people approach their respective counters in parallel. But this is not how lockless queues work. Instead, the person at the head of the queue holds a baton and when multiple numbers are called, everybody waiting in the queue goes up to the counter of the person holding the baton. Once that head-of-the-queue has made it to the counter, they give the baton to the person behind them who then drags everybody along to their counter. And so on.
The article was arguing for a lockless channel implementation akin to your interpretation of a queue with parallel access to the counters.