conditional-variable Questions
1
I'm testing edge cases with std::condition_variable and I tested scenario to starve one thread.
Scenario is that there are 99 producers and only one consumer, all of them working on 1 queue with ma...
Steatopygia asked 10/11, 2023 at 8:59
1
Solved
https://doc.rust-lang.org/stable/std/sync/struct.Condvar.html
use std::sync::{Arc, Mutex, Condvar};
use std::thread;
let pair = Arc::new((Mutex::new(false), Condvar::new()));
let pair2 = Arc::clon...
Horticulture asked 30/1, 2022 at 15:39
1
© 2022 - 2025 — McMap. All rights reserved.