• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Fox Hu
Ranch Hand
Posts: 49
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Will a thread continue to run after yield() for a while ?
 
Anonymous
Ranch Hand
Posts: 18944
  • 0
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic