Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ArrayQueue ¶
type ArrayQueue struct {
// contains filtered or unexported fields
}
* 顺序队列:用数组实现的队列 同样是个循环队列
func (*ArrayQueue) Dequeue ¶
func (this *ArrayQueue) Dequeue() interface{}
func (*ArrayQueue) Enqueue ¶
func (this *ArrayQueue) Enqueue(data interface{}) bool
type BlockArrayQueue ¶
type BlockArrayQueue struct {
// contains filtered or unexported fields
}
* 阻塞队列 数组实现方式 利用双向cahnnel TODO 使用CAS保证出队和入队的线程安全性,即是实现一种线程安全队列
func (*BlockArrayQueue) Dequeue ¶
func (this *BlockArrayQueue) Dequeue() interface{}
* 先获取lockers,然后才能获取items
func (*BlockArrayQueue) Enqueue ¶
func (this *BlockArrayQueue) Enqueue(data interface{}) bool
* 先写入items,然后写入lockers
type LinkedList ¶
func (*LinkedList) Exist ¶
func (this *LinkedList) Exist(value interface{})
func (*LinkedList) Insert ¶
func (this *LinkedList) Insert(node *Node)
func (*LinkedList) InsertHead ¶
func (this *LinkedList) InsertHead(node *Node)
func (*LinkedList) PrintList ¶
func (this *LinkedList) PrintList()
func (*LinkedList) Remove ¶
func (this *LinkedList) Remove(node *Node)
Click to show internal directories.
Click to hide internal directories.