Two-enqueuer queue in Common2

Two-enqueuer queue in Common2
Notice: This research summary and analysis were automatically generated using AI technology. For absolute accuracy, please refer to the [Original Paper Viewer] below or the Original ArXiv Source.

The question of whether all shared objects with consensus number 2 belong to Common2, the set of objects that can be implemented in a wait-free manner by any type of consensus number 2, was first posed by Herlihy. In the absence of general results, several researchers have obtained implementations for restricted-concurrency versions of FIFO queues. We present the first Common2 algorithm for a queue with two enqueuers and any number of dequeuers.


💡 Research Summary

The paper addresses a long‑standing open question posed by Herlihy: whether every shared object with consensus number 2 belongs to the class Common2, i.e., can be implemented wait‑free using any object of consensus number 2. While several objects such as Fetch&Add, Swap, and Stack have already been shown to be in Common2, the status of the FIFO Queue remained unresolved. Existing wait‑free queue constructions either restrict the number of enqueuers or dequeuers, or rely on stronger primitives. This work presents the first wait‑free algorithm that supports exactly two concurrent enqueuers and an arbitrary number of dequeuers, thereby establishing that Queue is indeed a member of Common2.

The authors begin by reviewing the consensus hierarchy and summarising known wait‑free queue implementations. They then describe a baseline single‑enqueuer/single‑dequeuer queue (Algorithm 1) and explain why naïve extensions to multiple enqueuers or dequeuers fail due to “overtaking” problems: an enqueuer may write to a location that a dequeuer has already claimed, or a dequeuer may read a location before the enqueuer has stored the item. David’s earlier algorithm solved the former by using a two‑dimensional array of Swap objects and a special “⊤” marker, but it does not extend directly to two enqueuers because simultaneous swaps on the same cell can leave an enqueuer uncertain about the outcome.

Algorithm 2 introduces a novel coordination scheme that overcomes these difficulties. The shared state consists of:

  • a two‑dimensional boolean array deqActive that records whether a dequeuer has started processing a cell,
  • integer counters enqCount, head, and row maintained locally by the enqueuers,
  • an unbounded array item storing the actual payloads,
  • a two‑dimensional integer array itemIndex mapping each cell (row, column) to the logical index of the enqueued item,
  • a one‑dimensional array itemTaken of Fetch&Add objects that provide exclusive ownership of each logical item,
  • a one‑dimensional array tail of Fetch&Add objects used by dequeuers to obtain the next column index in a given row.

When an enqueuer adds an item, it increments enqCount, stores the payload in `item


Comments & Academic Discussion

Loading comments...

Leave a Comment