Documentation ¶
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewSafeMap ¶
func NewSafeMap() *safeMap
Types ¶
type Queue ¶
type Queue struct {
// contains filtered or unexported fields
}
Queue implements lock-free FIFO freelist based queue. ref: https://dl.acm.org/citation.cfm?doid=248052.248106
Example ¶
q := NewQueue() q.Enqueue("1st item") q.Enqueue("2nd item") q.Enqueue("3rd item") fmt.Println(q.Dequeue()) fmt.Println(q.Dequeue()) fmt.Println(q.Dequeue())
Output: 1st item 2nd item 3rd item
func (*Queue) Dequeue ¶
func (q *Queue) Dequeue() interface{}
Dequeue removes and returns the value at the head of the queue. It returns nil if the queue is empty.
Click to show internal directories.
Click to hide internal directories.