IntelliJ Java IDE
The moose likes Threads and Synchronization and the fly likes thread will leave the running state Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Threads and Synchronization
Reply Bookmark "thread will leave the running state" Watch "thread will leave the running state" New topic
Author

thread will leave the running state

Saral Saxena
Ranch Hand

Joined: Apr 22, 2011
Posts: 200

Hi Folks ,
Please suggest the ways in which a running thread will leave the running state ...Please explain it in detail..!! Thanks in advance..!!
Henry Wong
author
Sheriff

Joined: Sep 28, 2004
Posts: 14610

Saral Saxena wrote:
Please suggest the ways in which a running thread will leave the running state ...Please explain it in detail..!! Thanks in advance..!!



What is there to explain? Threads leaving the running state for two reasons. One, there is nothing to run. Two, there is another thread that needs to run.

Running means that it is on a CPU/core doing stuff. Otherwise, it is not.

Henry


Books: Java Threads, 3rd Edition, Jini in a Nutshell, and Java Gems (contributor)
 
jQuery in Action, 2nd edition
 
subject: thread will leave the running state
 
Threads others viewed
Question from k&B's masterexam about yield()???????
Does a thread always move to the ready state if yield method is called?
Thread states?
join() mock exam question
notify and notifyAll
IntelliJ Java IDE