wood burning stoves 2.0*
The moose likes Beginning Java and the fly likes Will a thread continue to run after yield() for a while ? 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 » Java » Beginning Java
Bookmark "Will a thread continue to run after yield() for a while ?" Watch "Will a thread continue to run after yield() for a while ?" New topic
Author

Will a thread continue to run after yield() for a while ?

Fox Hu
Ranch Hand

Joined: Jan 23, 2003
Posts: 49
Will a thread continue to run after yield() for a while ?
Anonymous
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
Originally posted by Neal Hanson:
Will a thread continue to run after yield() for a while ?

Yes, the yield() method is a very polite method; it simply tells other threads that this thread took its share and now other threads can do whatever they want to do. If no other threads exist, yield() does nothing ... Typically yield() can be found in bodies of very computational bound loops and the like.
kind regards
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Will a thread continue to run after yield() for a while ?