Closed
Description
I'm not sure how to handle concurrent containers in the standard library. In a 1:1 threading situation, it's best to use the native mutex and condition variable types because they're highly optimized. On Linux, they only actually need to do a system call when there's contention or consumer exhaustion because they spin a bit before waiting on futex
.
The standard library has a form of M:N queues already, but they block on the scheduler so they aren't going to work well for 1:1 threading.
https://github.com/thestinger/rust-core/blob/master/core/concurrent.rs (blocking bounded/unbounded queues and priority queues with native synchronization primitives)