Byte Depth
← All tags

#Condition Variables

2 articles

Concurrency

Blocking Queue — Producer-Consumer

Implement a thread-safe bounded blocking queue from scratch using ReentrantLock and Condition variables — the canonical producer-consumer concurrency problem.

Aug 10, 2026
ConcurrencyJavaMultithreading

Concurrency

Print Zero-Odd-Even — Three-Thread Sequencing

Three threads must interleave to print '0102030405…' — zero before every number, odd and even alternating. Solved with ReentrantLock and three dedicated Condition variables.

Aug 10, 2026
ConcurrencyJavaMultithreading
© 2026 ByteDepth. All rights reserved.Built with care for curious engineers.