Documentation
¶
Overview ¶
Package queue provides a lock-free queue. The underlying algorithm is one proposed by Michael and Scott. https://doi.org/10.1145/248052.248106
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Queue ¶
type Queue struct {
// contains filtered or unexported fields
}
Queue is a lock-free unbounded queue.
Example ¶
q := NewQueue()
q.Enq("1st item")
q.Enq("2nd item")
q.Enq("3rd item")
fmt.Println(q.Deq())
fmt.Println(q.Deq())
fmt.Println(q.Deq())
Output: 1st item 2nd item 3rd item
Click to show internal directories.
Click to hide internal directories.