4 ms·
In Rust there's a thing called Condvar https://doc.rust-lang.org/std/sync/struct.Condvar.html https://doc.rust-lang.org/std/sync/struct.Condvar.html I don't re
by scotty79 4y ago
In Rust there's a thing called Condvar https://doc.rust-lang.org/std/sync/struct.Condvar.html https://doc.rust-lang.org/std/sync/struct.Condvar.html
I don't really know how it relates to semaphores but it was exactly what I needed last time when I wanted to parallelize some computation and I needed to pause starved threads and unpause them all of them only after the last one got starved and triggered generation of next data block and moved focus of computation to that new block.
- gpderetta 4y agoCond vars are always coupled with a mutex, they are also stateless and edge triggered, that make them a bit different from semaphores.