This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Conditions that stop threads from executing Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Conditions that stop threads from executing" Watch "Conditions that stop threads from executing" New topic
Author

Conditions that stop threads from executing

Joyce Lee
Ranch Hand

Joined: Jul 11, 2003
Posts: 1392
Hi all,
According to knB of page 508, it mentions that "stopping threads from executing" means "moving a thread to a nonrunnable state".
Could someone advise me if I'm right with the following statements?
Conditions that stop a thread from executing:
sleep(), wait(), join(), blocked because it needs an object locks
Conditions NOT counted as stopping a thread from executing:
yield(), another thread is given higher priority
Thanks
Joyce
Andres Gonzalez
Ranch Hand

Joined: Nov 27, 2001
Posts: 1561
Hmm.. yes, yield() does not guarantee that the thread will move from the running to runnable state. And if it does, the same thread might be chosen again to the running state.


I'm not going to be a Rock Star. I'm going to be a LEGEND! --Freddie Mercury
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Conditions that stop threads from executing