A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Win a copy of
OCA Java SE 8 Programmer I Study Guide 1Z0-808
this week in the
Programmer Certification (SCJP/OCPJP)
Thread.yield() method - where do we call it
Joined: May 22, 2009
Nov 12, 2009 18:38:21
Just wondering where we should call the yield() method.
In main() or run() ?
I guess in run(), correct me if I'm wrong.
Joined: Sep 28, 2004
Nov 12, 2009 20:16:43
The thread that you want to yield should call the Thread.yield() method.
Java Threads, 3rd Edition
Jini in a Nutshell
Java Gems (contributor)
Joined: Feb 24, 2006
Nov 12, 2009 21:24:46
It depends on which thread you want to yield(). Place the appropriate call there
SCJP 6 articles
SCJP 5/6 mock exams
More SCJP Mocks
subject: Thread.yield() method - where do we call it
regarding thread run method
Why start() method
Difference between run and start method of Thread
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2015