Answer to Question #253219 in Java | JSP | JSF for Tarurendra Kushwah

Question #253219

Briefly explain the Thread Life cycle.


1
Expert's answer
2021-10-23T08:06:02-0400
In its lifecycle, a thread goes through several stages. A thread, for example, gets born, starts, runs and eventually dies.

The following are the stages of the thread's lifecycle.

New- In the new state, a new thread begins its life cycle. It will stay in this state until the thread is started by the program. A born thread is another name for it.

Runnable- When a freshly created thread is initiated, it becomes runnable. When a thread is in this position, it is regarded to be doing its job.

Waiting- When a thread is waiting for another thread to complete a job, it may shift to the waiting state. Only when another thread signals the waiting thread to continue executing does the thread transition back to the runnable state.

Timed Waiting- A runnable thread can go into a timed waiting state for a set amount of time. When the period expires or the event it is waiting for occurs, a thread in this state moves back to the runnable state.

Terminated (Dead) - 

When a runnable thread completes its task or otherwise terminates, it enters the terminated state.

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS