Thread Priorities Threads are assigned priorities that the thread scheduler can use to determine how the threads will be scheduled…. Read more
Thread Scheduler – Concurrency: Part I
Thread Scheduler Schedulers in JVM implementations usually employ one of the following two strategies, which come into play in the… Read more
Creating Temporary Directories – Java I/O: Part II
Creating Temporary Directories Analogous to temporary files, temporary directories can be created by the create-TempDirectory() methods of the Files class…. Read more
Executing Synchronized Code – Concurrency: Part I
Executing Synchronized Code Threads share the same memory space—that is, they can share resources. However, there are critical situations where… Read more
Synchronized Methods – Concurrency: Part I
Synchronized Methods If the methods of an object should only be executed by one thread at a time, then the… Read more
Reentrant Synchronization – Concurrency: Part I
Reentrant Synchronization While a thread is inside a synchronized method of an object, all other threads that wish to execute… Read more
Reading Text Lines Using a Functional Stream – Java I/O: Part II
Reading Text Lines Using a Functional Stream The lines() method of the Files class creates a stream that can be… Read more
Synchronized Statements – Concurrency: Part I
Synchronized Statements Whereas execution of synchronized methods of an object is synchronized on the lock of the object, the synchronized… Read more
Interrupt Handling – Concurrency: Part I
Interrupt Handling The purpose of interrupts is to allow threads to inform each other when the task they are running… Read more
Sleeping and Waking Up – Concurrency: Part I
Sleeping and Waking Up Transitions by a thread that is sleeping and waking up are illustrated in Figure 22.8. A… Read more