Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CQueue ¶
type CQueue 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) 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 struct {
// contains filtered or unexported fields
}
LQueue is a concurrent unbounded queue which uses two-Lock concurrent queue qlgorithm.
func (*LQueue) 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 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(initCapacity int) UnboundedChan
NewUnboundedChan create a unbounded channel
func (UnboundedChan) BufLen ¶
func (ubc UnboundedChan) BufLen() int
BufLen returns len of the buffer.
func (UnboundedChan) IsEmpty ¶
func (ubc UnboundedChan) IsEmpty() bool
IsEmpty returns true if the container length == 0
func (UnboundedChan) Len ¶
func (ubc UnboundedChan) Len() int
Len returns len of Out plus len of buffer.
func (UnboundedChan) Poll ¶
func (ubc UnboundedChan) 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) Push ¶
func (ubc UnboundedChan) Push(vs ...T)
Push adds items of vs to the tail of queue