February 2014
Beginner
1248 pages
62h 25m
English
• Thread synchronization (p. 968) coordinates access to shared mutable data by multiple concurrent threads.
• By synchronizing threads, you can ensure that each thread accessing a shared object excludes all other threads from doing so simultaneously—this is called mutual exclusion (p. 968).
• A common way to perform synchronization is to use Java’s built-in monitors. Every object has a monitor and a monitor lock (p. 968). The monitor ensures that its object’s monitor lock is held by a maximum of only one thread at any time, and thus can be used to enforce mutual exclusion.
• If an operation requires the executing thread to hold a lock while the operation is performed, a thread must acquire the lock (p. 968 ...
Read now
Unlock full access