4 releases

0.1.3 Jan 10, 2024
0.1.2 Oct 27, 2022
0.1.1 Oct 27, 2022
0.1.0 Oct 27, 2022

#163 in Concurrency

Download history 19859/week @ 2024-07-28 19764/week @ 2024-08-04 18856/week @ 2024-08-11 21361/week @ 2024-08-18 19718/week @ 2024-08-25 22278/week @ 2024-09-01 21312/week @ 2024-09-08 17968/week @ 2024-09-15 21221/week @ 2024-09-22 19812/week @ 2024-09-29 21860/week @ 2024-10-06 23884/week @ 2024-10-13 25105/week @ 2024-10-20 23642/week @ 2024-10-27 27325/week @ 2024-11-03 25121/week @ 2024-11-10

102,747 downloads per month
Used in 46 crates (via dhat)

Apache-2.0

7KB
127 lines

mintex

A minimal Mutex

A drop-in for std::sync::Mutex which doesn't do poisoning. The lock will spin and yield if the lock isn't acquired. The implementation doesn't attempt to be "fair", but because it's so simple it is fast.

The main reason for it to exist, is because I know it does not allocate memory during execution and that's a desirable feature for some use cases.

I have run the tests under miri and no issues are detected.

Crates.io

API Docs

Installation

[dependencies]
mintex = "0.1"

License

Apache 2.0 licensed. See LICENSE for details.


lib.rs:

mintex is a minimal Mutex.

Most of the implementation is lifted from std::sync::Mutex. The reason for this mutex existing is that I'd like a mutex which is quite lightweight and does not perform allocations.

No runtime deps