Home » Tutorials » Java Programming » Synchronizing Threads
Synchronizing Threads
664
Category : Tutorials » Java Programming
. example, imagine a Java application where one thread (the producer) writes data to . http://java.sun.com/docs/books/tutorial/essential/threads .
Download File Free PDF eBooks Download Tutorials Java Programming
Synchronizing Threads So far, this lesson has contained examples with independent, asynchronous threads. That is, each thread contained all of the data and methods required for its execution and didn't require any outside resources or methods. In addition, the threads in those examples ran at their own pace without concern over the state or activities of any other concurrently running threads.
For example, imagine a Java application where one thread (the producer) writes data to a file while a second thread (the consumer) reads data from the same file. Or, as you type characters on the keyboard, the producer thread places key events in an event queue and the consumer thread reads the events from the same queue. Both of these examples use concurrent threads that share a common resource: the first shares a file, the second shares an event queue. Because the threads share a common resource, they must be synchronized in some way.
Favorite Java Programming PDF File
2858
AspectJ2EE AOP J2EE
category Tutorials » Java Programming
3487
J2EE EJB Overview
category Tutorials » Java Programming
1214
Unraveling The Mysteries of J2EE Web Applicatuib Communications
category Tutorials » Java Programming
3730
Experience J2EE Using WebSphere Application Server V6 1
category Tutorials » Java Programming
3595

