Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CQueue ¶
type CQueue[T any] struct { // contains filtered or unexported fields }
CQueue is a lock-free (CAS) unbounded queue. https://www.cs.rochester.edu/u/scott/papers/1996_PODC_queues.pdf
func (*CQueue[T]) Peek ¶
Peek Retrieves, but does not remove, the head of this queue, or returns (nil, false) if this queue is empty.
type LQueue ¶
type LQueue[T any] struct { // contains filtered or unexported fields }
LQueue is a concurrent unbounded queue which uses two-Lock concurrent queue qlgorithm.
func (*LQueue[T]) Peek ¶
Peek Retrieves, but does not remove, the head of this queue, or returns (nil, false) if this queue is empty.
type UnboundedChan ¶
type UnboundedChan[T any] struct { In chan<- T // channel for write Out <-chan T // channel for read // contains filtered or unexported fields }
UnboundedChan unbounded channel
func NewUnboundedChan ¶
func NewUnboundedChan[T any](initCapacity int) UnboundedChan[T]
NewUnboundedChan create a unbounded channel
func (UnboundedChan[T]) BufLen ¶
func (ubc UnboundedChan[T]) BufLen() int
BufLen returns len of the buffer.
func (UnboundedChan[T]) IsEmpty ¶
func (ubc UnboundedChan[T]) IsEmpty() bool
IsEmpty returns true if the container length == 0
func (UnboundedChan[T]) Len ¶
func (ubc UnboundedChan[T]) Len() int
Len returns len of Out plus len of buffer.
func (UnboundedChan[T]) Poll ¶
func (ubc UnboundedChan[T]) Poll() (v T, ok bool)
Poll Retrieves and removes the head of this queue, or returns (nil, false) if this queue is empty.
func (UnboundedChan[T]) Push ¶
func (ubc UnboundedChan[T]) Push(vs ...T)
Push adds items of vs to the tail of queue