Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type IQueue ¶
func NewChanQueue ¶
func NewLockfreeQueue ¶
NewLockfreeQueue creates a new lock-free queue.
func NewMutexSliceQueue ¶
type LockFreeQueue ¶
type LockFreeQueue[T any] struct { // contains filtered or unexported fields }
LockFreeQueue implements lock-free FIFO freelist based queue. ref: https://dl.acm.org/citation.cfm?doid=248052.248106
func (*LockFreeQueue[T]) Dequeue ¶
func (q *LockFreeQueue[T]) Dequeue() (value T, ok bool)
Dequeue removes and returns the value at the head of the queue. It returns nil if the queue is empty.
func (*LockFreeQueue[T]) Enqueue ¶
func (q *LockFreeQueue[T]) Enqueue(v T)
Enqueue puts the given value v at the tail of the queue.
func (*LockFreeQueue[T]) Length ¶
func (q *LockFreeQueue[T]) Length() uint64
Length returns the length of the queue.
type MutexSliceQueue ¶
type MutexSliceQueue[T any] struct { // contains filtered or unexported fields }
func (*MutexSliceQueue[T]) Dequeue ¶
func (q *MutexSliceQueue[T]) Dequeue() (value T, ok bool)
func (*MutexSliceQueue[T]) Enqueue ¶
func (q *MutexSliceQueue[T]) Enqueue(v T)
func (*MutexSliceQueue[T]) Length ¶
func (q *MutexSliceQueue[T]) Length() uint64
Click to show internal directories.
Click to hide internal directories.