O'Reilly logo

Java™ Network Programming and Distributed Computing by Michael Reilly, David Reilly

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

7.4. Interthread Communication

While threads can, of course, act in isolation (in fact, a design that requires no communication between threads lends itself to a far simpler implementation), sometimes it is necessary for threads to communicate with each other. Often, the type of communication will be fairly simple, such as reading or modifying a public member variable, or invoking an object method. Other times, more sophisticated communication is called for. Two good options for communication are communication pipes and the wait()/notify() methods, which allow one thread to notify a waiting thread of an event.

7.4.1. Communication Pipes between Threads

Like multiprocess communication, which uses pipes to send data from one process to another, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required