Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

github.com/anisus/queue

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/anisus/queue

  • v0.0.0-20120817094233-6838c8c7443d
  • Source
  • Go
  • Socket score

Version published
Created
Source

PACKAGE

package queue import "github.com\anisus\queue"

    Package queue implements a non-blocking concurrent first-in-first-out queue algorithm
	as described in the paper:
        Simple, Fast, and Practical Non-Blocking and Blocking
        Concurrent Queue Algorithms \Lambda
        Maged M. Michael Michael L. Scott
        Department of Computer Science
        University of Rochester
        Rochester, NY 14627-0226
        fmichael,scottg@cs.rochester.edu
		http://www.cs.rochester.edu/u/scott/papers/1996_PODC_queues.pdf
	The original paper uses a counter and a CAS2 instruction to
	avoid the ABA problem. Since CAS2 instructions is not available in Go,
	the package	uses a hack similar to that used in Microsoft Invisible Computing:
	http://research.microsoft.com/en-us/um/redmond/projects/invisible/src/queue/queue.c.htm

TYPES

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

func New() *Queue New returns an initialized queue

func (q *Queue) Dequeue() (value interface{}, ok bool) Dequeue returns the value at the head of the queue and true, or if the queue is empty, it returns a nil value and false

func (q *Queue) Enqueue(value interface{}) Enqueue inserts the value at the tail of the queue

FAQs

Package last updated on 17 Aug 2012

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc