Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

oscgithub/queue-1

Open more actions menu
 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

queue

import "github.com/n1060/queue"

Package queue provides a lock-free queue. The underlying algorithm is one proposed by Michael and Scott. https://doi.org/10.1145/248052.248106

Usage

type Queue

type Queue struct {
    // contains filtered or unexported fields
}

Queue is a lock-free unbounded queue.

func NewQueue

func NewQueue() (q *Queue)

NewQueue returns a pointer to an empty queue.

func (*Queue) Deq

func (q *Queue) Deq() interface{}

Deq removes and returns the value at the head of the queue. It returns nil if the queue is empty.

func (*Queue) Enq

func (q *Queue) Enq(v interface{})

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

About

Lock-Free Queue for Go

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 100.0%
Morty Proxy This is a proxified and sanitized view of the page, visit original site.