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

#194 in Concurrency

Download history 13919/week @ 2023-12-06 11597/week @ 2023-12-13 7004/week @ 2023-12-20 5432/week @ 2023-12-27 9776/week @ 2024-01-03 11438/week @ 2024-01-10 14165/week @ 2024-01-17 16701/week @ 2024-01-24 12533/week @ 2024-01-31 12861/week @ 2024-02-07 13495/week @ 2024-02-14 16610/week @ 2024-02-21 13705/week @ 2024-02-28 15647/week @ 2024-03-06 16267/week @ 2024-03-13 11780/week @ 2024-03-20

59,940 downloads per month
Used in 38 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