Skip to content

java-concurrency

24 Posts

Wait and Notify in Java: The Rules That Stop the Hangs

wait() and notify() hang or corrupt data when the guard, the lock or the wakeup is wrong. Lost signals, stolen wakeups and notify vs notifyAll, run on JDK 21.

Java Condition Variables: await/signal vs wait/notify

A Java condition variable gives one lock several wait sets. How await() and signal() work, why one Condition hangs a buffer, and a bounded buffer done right.

Semaphore in Java: Permits, Leaks and Virtual Threads

A Java Semaphore is a counter with a wait queue, not a lock. Why release() can mint permits, how leaks starve a pool, and how to cap virtual threads safely.