November 2015
Intermediate to advanced
220 pages
4h 30m
English
CHAPTER 3
![]()
Waiting and Notification
Java provides a small API that supports communication between threads. Using this API, one thread waits for a condition (a prerequisite for continued execution) to exist. In the future, another thread will create the condition and then notify the waiting thread. In this chapter, I introduce you to this API.
Wait-and-Notify API Tour
The java.lang.Object class provides a Wait-and-Notify API that consists of three wait() methods, one notify() method, and one notifyAll() method. The wait() methods wait for a condition to exist; the notify() and notifyAll() methods notify waiting threads when the condition exists: ...
Read now
Unlock full access