sema

Crates.iosema
lib.rssema
version0.1.4
sourcesrc
created_at2015-08-05 19:50:42.813482
updated_at2015-12-11 23:55:55.315022
descriptionRust semaphore library
homepagehttps://github.com/cpjreynolds/sema
repositoryhttps://github.com/cpjreynolds/sema
max_upload_size
id2763
size19,701
Cole Reynolds (cpjreynolds)

documentation

https://cpjreynolds.github.io/sema

README

sema

A simple semaphore.

Build Status Crates.io Crates.io

Documentation

Usage

Add this to your Cargo.toml:

[dependencies]

sema = "*"

and this to your crate root:

extern crate sema;

Overview

Sema provides a safe Semaphore implementation.

Implementation

Sema has the same semantics on all supported platforms, however due to platform differences, the implementation differs between them.

Linux

On Linux, Semaphores are implemented with futexes. They are based on the current glibc sem_t implementation and share the same semantics.

OS X

OS X does not implement unnamed semaphores, however it does implement named semaphores, which share the same semantics as their unnamed counterparts but may be shared between processes.

Sema implements pseudo-unnamed semaphores with randomly named semaphores. Since the semantics of their operations remain the same, the only difference is their construction and destruction, however this is transparent to a consumer of this library.

Other Platforms

Sema should, in theory, work on any platform that supports POSIX semaphores (or futexes, in the case of Linux). That being said, it would be wise to consult your platform's semaphore manpages just in case.

Commit count: 27

cargo fmt