Interrupted This means that another thread invoked the interrupt() method on the waiting thread. The awakened thread is enabled as… Read more
Category: Searching for Directory Entries
Joining – Concurrency: Part I
Joining A thread can invoke the overloaded method join() (from the Thread class) on another thread in order to wait… Read more
Blocking for I/O – Concurrency: Part I
Blocking for I/O A running thread, on executing a blocking operation requiring a resource (like a call to an I/O… Read more
Walking the Directory Hierarchy – Java I/O: Part II
Walking the Directory Hierarchy The walk() method of the Files class creates a stream to walk or traverse the directory… Read more
Understanding Concurrency and Parallelism – Concurrency: Part I
Understanding Concurrency and Parallelism There is an important distinction between the concept of parallelism and concurrency when it comes to… Read more
Creating Threads – Concurrency: Part I
22.3 Creating Threads A thread in Java is represented by an object of the java.lang.Thread class. Every thread in Java… Read more
Thread Lifecycle – Concurrency: Part I
22.4 Thread Lifecycle Before diving into the lifecycle of a thread, a few important thread-related concepts should be understood. Objects,… Read more
Thread States – Concurrency: Part I
Thread States Understanding the lifecycle of a thread can be beneficial when programming with threads. Threads can exist in different… Read more
Thread Priorities – Concurrency: Part I
Thread Priorities Threads are assigned priorities that the thread scheduler can use to determine how the threads will be scheduled…. 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