| Author |
Thread.yield() method - where do we call it
|
Charles Chikito
Ranch Hand
Joined: May 22, 2009
Posts: 76
|
|
Hello there,
Just wondering where we should call the yield() method.
In main() or run() ?
I guess in run(), correct me if I'm wrong.
thanks
_charles
|
 |
Henry Wong
author
Sheriff
Joined: Sep 28, 2004
Posts: 16680
|
|
The thread that you want to yield should call the Thread.yield() method.
Henry
|
Books: Java Threads, 3rd Edition, Jini in a Nutshell, and Java Gems (contributor)
|
 |
Deepak Bala
Bartender
Joined: Feb 24, 2006
Posts: 6588
|
|
|
It depends on which thread you want to yield(). Place the appropriate call there
|
SCJP 6 articles - SCJP 5/6 mock exams - SCJP Mocks - SCJP 5 Mock exam (Word document ) - SCJP 5 Mock exam in Java.Inquisition format
|
 |
 |
I agree. Here's the link: jrebel
|
|
subject: Thread.yield() method - where do we call it
|
|
|