> For the complete documentation index, see [llms.txt](https://gyansetu-java.gitbook.io/core-java/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://gyansetu-java.gitbook.io/core-java/threads/thread-lifecycle.md).

# Thread Lifecycle

A thread can exist in multiple states: NEW, RUNNABLE, WAIT, TIMED\_WAITING, BLOCKED, or TERMINATED. A thread doesn’t begin its execution with its instantiation. Figure below shows the various phases of a thread, including the methods that can be called on a thread object in each state, which makes it transition from one state to another.

![](https://3494582050-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LSemf7mp1liQa7nfIAC%2F-LTw3FKKBb_8OIBy7Lmq%2F-LTw4QTWCyewvOgL6qNj%2Fimage.png?alt=media\&token=93474a6c-d066-4dd5-a653-9e7518201770)

![](https://3494582050-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LSemf7mp1liQa7nfIAC%2F-LTwwsO1SvJT9ZGzuGlS%2F-LTwxlCg-Yq7peXXHy2S%2FScreen%20Shot%202018-12-17%20at%209.49.12%20PM.png?alt=media\&token=dd8f2d16-6d92-4748-ba35-fbc9ec378f00)

#### Note:

Thread scheduling is specific to the underlying OS on every system. As a programmer, you can’t control or determine when a particular thread transitions from the READY state to the RUNNING state, and when it actually gets to execute. A thread scheduler fol- lows various scheduling mechanisms to utilize a processor efficiently, and also to give a fair share of processor time to each thread. It might suspend a running thread to give way to other READY threads and it might execute it later. The READY and the RUNNING states are together referred to as the RUNNABLE state.

![](https://3494582050-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LSemf7mp1liQa7nfIAC%2F-LTwwsO1SvJT9ZGzuGlS%2F-LTx9xthS7vo50HGv1qb%2FScreen%20Shot%202018-12-17%20at%2010.46.47%20PM.png?alt=media\&token=8bc1c945-0467-4a54-abad-4f9f068de325)
