Thread Signaling in Java

Опубликовано: 01 Ноябрь 2024
на канале: Jakob Jenkov
12,363
458

Java has a set of thread signaling features that enable one Java thread to coordinate its actions with another. These basic thread signaling features are provided via the Object class wait() , notify() and notifyAll() methods.

When implementing thread signaling in Java you need to be aware of the problem of missed signals and spurious wakeups. I cover both in this video too.

Chapters:
0:00 Java Thread signaling introduction - wait(), notify() and notifyAll()
1:50 Calling wait(), notify() or notifyAll() must be done from within a synchronized block
2:31 Calling wait() releases the synchronization lock
5:50 Designing a thread signaling class in Java
9:17 Missed signals
17:24 notify() vs. notifyAll()
19:24 Spurious wakeups

Java Thread Signaling - text:
https://jenkov.com/tutorials/java-con...

Java Concurrency - text:
https://jenkov.com/tutorials/java-con...

Java Concurrency - playlist:
   • Java Concurrency and Multithreading