Topics / Coding: Concurrency Primitives / Q10
How do you implement producer-consumer synchronization?
Use a bounded queue protected by a mutex and two condition variables for not-empty and not-full; wait in predicate loops.
Use a bounded queue protected by a mutex and two condition variables for not-empty and not-full; wait in predicate loops.