2 ms·
The parking lot concept is also really neat! The premise is that a program with lots of mutexes doesn't actually need to allocate lots of blocking queues, becau
by oconnor663 5y ago
The parking lot concept is also really neat! The premise is that a program with lots of mutexes doesn't actually need to allocate lots of blocking queues, because the number of simultaneous waiters is bounded by the number of threads.
I don't think it's a coincidence that both of the examples here are actually quite reasonable as standalone crates. They're important abstractions, but just a little bit too niche to justify a place in the standard library. That said, I agree that learning what all these crates mean is daunting, and that finding ways to make that easier somehow would be valuable.
- roblabla 5y ago> just a little bit too niche to justify a place in the standard library parking_lot has actually been considered for inclusion in libstd[0], as a better alternative to the native mutex implementation (parking_lot mutex are smaller, can be const-initialized, can be moved, and tend to perform better - all while not depending on external, non-rust code). The effort is currently on hold, but it's possible that it will resume in the future. [0]: https://github.com/rust-lang/rust/pull/56410 https://github.com/rust-lang/rust/pull/56410