queue

package
v0.8.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 13, 2025 License: MIT, Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LockFreeQueue added in v0.3.0

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 NewLockFreeQueue added in v0.3.0

func NewLockFreeQueue[T any]() *LockFreeQueue[T]

NewLockFreeQueue creates a new lock-free queue.

func (*LockFreeQueue[T]) Dequeue added in v0.3.0

func (q *LockFreeQueue[T]) Dequeue() (T, 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 added in v0.3.0

func (q *LockFreeQueue[T]) Enqueue(v T)

Enqueue puts the given value v at the tail of the queue.

func (*LockFreeQueue[T]) Length added in v0.3.0

func (q *LockFreeQueue[T]) Length() uint64

Length returns the length of the queue.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL