Threads
A thread can be in one of the following states
NEW - A thread that has not yet started is in this state.
RUNNABLE - A thread executing in the java virtual machine is in this state.
BLOCKED - A thread that is blocked waiting for a monitor lock is in this state.
WAITING - A thread that is waiting indefinitely for another thread to perform particular action is in this state.
TIMED_WAITING - A thread that is waiting for a another thread to perform an action for up to a specified waiting time in this state.
TERMINATED - A thread that has exited
Multitasking vs Multithreading vs Multiprocessing vs parallel processing
Multitasking - Using single cpu core, execute more than one task at the same time is known as multi tasking.
Multithreading - It is a process of executing multiple threads simultaneously.
Multiprocessing - It is same as multitasking however in multi processing more than one CPUs are involved.
Thread priorities (MIN_PRIORITY, NORM_PRIORITY, MAX_PRIRORITY)
- Thread priority decides when to switch from one running thread to another, process is called context switching