Explain the available thread states in a high-level.

Technology CommunityCategory: JavaExplain the available thread states in a high-level.
VietMX Staff asked 3 years ago

During its execution, a thread can reside in one of the following states:

  • Runnable: A thread becomes ready to run, but does not necessarily start running immediately.
  • Running: The processor is actively executing the thread code.
  • Waiting: A thread is in a blocked state waiting for some external processing to finish.
  • Sleeping: The thread is forced to sleep.
  • Blocked on I/O: Waiting for an I/O operation to complete.
  • Blocked on Synchronization: Waiting to acquire a lock.
  • Dead: The thread has finished its execution.