Byte Depth
← All tags

#Deadlock

2 articles

Concurrency

Building H2O — Semaphores + CyclicBarrier

Coordinate hydrogen and oxygen threads so they always form complete H2O molecules — never a stray atom — using two semaphores to enforce stoichiometry and a CyclicBarrier to synchronize the triplet.

Aug 10, 2026
ConcurrencyJavaMultithreading

Concurrency

Dining Philosophers — Deadlock-Free Fork Ordering

Five philosophers, five forks, one circular table — eliminate the circular wait that causes deadlock by acquiring forks in a fixed global index order, never left-before-right.

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