https://github.com/mpdn/try-mutex
A non-blocking mutual exclusion primitive
https://github.com/mpdn/try-mutex
Last synced: 11 months ago
JSON representation
A non-blocking mutual exclusion primitive
- Host: GitHub
- URL: https://github.com/mpdn/try-mutex
- Owner: mpdn
- Created: 2018-05-27T14:10:22.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2022-10-27T16:13:29.000Z (over 3 years ago)
- Last Synced: 2024-08-10T07:51:08.542Z (almost 2 years ago)
- Language: Rust
- Size: 15.6 KB
- Stars: 10
- Watchers: 5
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
A simple non-blocking mutex (i.e. only `try_lock` is supported), using atomics.
Simpler than the one found in stdlib. Does not support poisoning.
This used to be faster than the mutex in the standard library, but benchmarking indicates that
optimizations in the standard library means there is no longer a significant difference
(on my machine). Be sure to run them on your own machine to compare.
Nevertheless, this library may still be useful for embedded or similar cases.