Executing Tasks in Threads We can consider a task as an independent activity that doesn’t depend on the result or side effect of other tasks. So, if you have sufficient resources (CPU, memory etc.), tasks can be executed in parallel.…
Tag: multithreading
Thread – Part 2
Synchronizers A synchronizer is any object that determines whether threads arriving at it should be forced to wait or allowed to proceed based on its state. Examples of synchronizers are semaphores, barriers, and latches. CountDownLatch A latch acts just like…
Thread – Part 1
Introduction A thread in Java simply means a single independent path to execute a group of statements one after another. Every thread in Java is represented by an object of class Thread. When we write a code, we basically write…