sync

module
v0.0.0-...-a9ff0e8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 13, 2018 License: MIT

README

Sync - Additional synchronization primtives

Go code (golang) set of packages that provide synchonization primitives beyond those provided by the golang sync package.

Primitives include:

Check out the API Documentation http://godoc.org/bitbucket.org/jbester/sync

events package

The events package provides a single synchronization primitive the Event. An event is used to notify the occurrence of a condition to routines.

Multiple routines can wait on a condition. All routines unblock once the condition occurs. A routine that waits on a condition that has already occurred will not block.

The event primitive is similar to the event in the pSOS or ARINC 653 API sets.

startgroup package

The startgroup package provides a mechanism for a collection of goroutines to wait for a release event. When released, all blocked routines simultaneously.

A typical use is when multiple routines need to know when a resource is available but do not need exclusive access to the resource.

semaphores package

The semaphores package provides a go implementation of binary and counting semaphores. It is designed to use atomic operations to maintain the semaphore count and a channel to signal waiting threads.

Installation

To install, use go get:

go get bitbucket.org/jbester/sync/...

This will then make the following packages available to you:

bitbucket.org/jbester/sync/semaphores
bitbucket.org/jbester/sync/events
bitbucket.org/jbester/sync/startgroup

Staying up to date

To update to the latest version, use go get -u bitbucket.org/jbester/sync.


Contributing

Please feel free to submit issues, fork the repository and send pull requests!


Licence

MIT License - see LICENSE file

Directories

Path Synopsis
Package events provides a single synchronization primitive - the Event.
Package events provides a single synchronization primitive - the Event.
Package semaphores provides a go implementation of binary and counting semaphores.
Package semaphores provides a go implementation of binary and counting semaphores.
Package startgroup provides a single synchronization primitive the StartGroup.
Package startgroup provides a single synchronization primitive the StartGroup.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL