Documentation ¶
Overview ¶
Package lockfree provides a concurrent blocking livelock-free FIFO queue. Described in https://doi.org/10.1145/248052.248106
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Queue ¶
type Queue[T any] struct { // contains filtered or unexported fields }
Queue implements a singly-linked list with a Push and Pop function.
Head always points to a dummy node, so we can assume head is never nil within the dequeue code. Tails always points to the last or second to last node in the list.
This Queue has some properties. See 3.1 to see the proof 1. The linked list is always connected. 2. Nodes are only inserted after the last node in the linked list. 3. Nodes are only deleted from the beginning of the linked list. 4. Head always points to the first node in the linked list. 5. Tail always points to a node in the linked list.