Thread Lifecycle: Want to start the multithreaded
programming? Before starting you need to know what is Thread and what
is the life cycle of the Thread. Thread having different states and
life cycle methods. To know about the thread you can Visit my last
post Java
Thread Example. Here we will talk about the life-cycle of the
Thread.
Following are the states in the life cycle of the Threads :
Following are the states in the life cycle of the Threads :
- New: When we initialize the new thread using new operator, new thread is created and state is called New Thread. In this state thread is not active or running.
- Runnable: At the time when we call Thread.start() method, state of thread object changed to Runnable and it's now on OS that it when or how it will get CPU to run. In this state the control is given to Thread scheduler to finish its execution.
No comments:
Post a Comment