5 releases
Uses old Rust 2015
0.1.4 | Aug 9, 2015 |
---|---|
0.1.3 | Aug 6, 2015 |
0.1.2 | Aug 5, 2015 |
0.1.1 | Aug 5, 2015 |
0.1.0 | Aug 5, 2015 |
#23 in #semaphore
87 downloads per month
Used in 3 crates
19KB
425 lines
sema
A simple semaphore.
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, Semaphore
s 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.
Dependencies
~1–1.3MB
~20K SLoC