Java 2
static synchronized
A ________ method must acquire the lock on the class that's used to call the method.
synchronization
A common way to perform ________ is to use Java's built-in monitors.
blocked
Any other threads attempting to perform an operation that requires the same lock will be _______ until the first thread releases the lock, at which point the _______ thread may attempt to acquire the lock.
non-static synchronized
Before executing, a _______ method must acquire the lock on the object that's used to call the method.
mutual exclusion
By synchronizing threads, you can ensure that each thread accessing a shared object excludes all other threads from doing so simultaneously- this is called _________.
monitor, monitor lock
Every object has a _______ and a ________.
awaitTermination
ExecutorService method _________ forces a program to wait for threads to terminate. It returns control to its caller either when all tasks executing in the ExecutorService complete or when the specified timeout elapses. If all tasks complete before the timeout elapses, the method returns true; otherwise it returns false.
executing thread
If an operation requires the _________ to hold a lock while the operation is performed, a thread must acquire the lock before it can proceed with the operation.
synchronized methods
Java also allows ___________.
one thread
The monitor ensures that its object's monitor lock is hed by a maximum of only __________ at any time, and thus can be used to enforce mutual exclusion.
synchronized(object)
The synchronized statements are declared using the synchronized keyword: ________ where object is the object whose monitor lock will be acquired; object is normally this if its object in which the synchronized statement appears.
synchronized, guarded
To specify that a thread must hold a monitor lock to execute a block of code, the code should be placed in a ________ statement. such code is said to be _______ by the monitor lock.
final
When you share immutable data across threads, you should declare the corresponding data fields ______ to indicate that variables' values will not change after they're initialized.
atomicity
You can simulate ______ by ensuring that only one thread performs a set of operations at a time. ________ can be acheived with synchronized statements or synchronized methods.
Thread synchronization
_______ coordinates access to shared data by multiple concurrent threads.