This week's book giveaway is in the OCPJP forum. We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line! See this thread for details.
does the yield() method definitely stop the thread from executing ? I have heards both yes and no as answers to this question. So what is the definite answer ? I have my exam next week, so i want a correct reply this time at least... also, will questions on threadgroups be asked on the exam ? did any of u guys who have taken the exam lately seen questions on Threadsgroups, suspend(0 and stop() methods etc on ur test ?Thanks jui
hi: A call to yield() doesn't gaurantee to do much of anything. It will cause the currently running thread to stop if and only if there are another thread waiting to run with equal or higher priority. I have taken the exam, and I havn't seen any question on the exam about ThreadGroup. Good Luck
SCJD 1.4<br />SCJP 1.4<br />-----------------------------------<br />"With regard to excellence, it is not enough to know, but we must try to have and use it.<br />" Aristotle
Would you like an answer from James Gosling? "Provides a hint to the scheduler that the current thread need not run at the present time, so the scheduler may choose another thread to run. The scheduler may follow or ignore this suggestion as it sees fit--you can generally rely on the scheduler to "do the right thing" even though there is no specification of exactly what that is" The Java Programming Language 10.6.1 And how about an answer from Doug Lea? "Thread.yield is a purely heuristic hint advising the JVM that if there are any other runnable but non-running threads, the scheduler should run one or more of these threads rather than the current thread. The JVM may interpret this hint in any way it likes." Concurrent Programming in Java 18.104.22.168