SCJP, SCWCD, SCBCD
SCJP 6 | SCWCD 5 | Javaranch SCJP FAQ | SCWCD Links
cmbhatt
SCJP, SCWCD, SCBCD
Since it invokes an arbitary method, I don;t understand what is the purpose of such an un-reliable method. {Unreliable: Chooses arbitary thread}.
SCJP 1.4 85%
Originally posted by Paul Clapham:
If the specification had said "It awakens the thread which has been waiting longest" or "It awakens the thread which has the highest priority" or anything else specific, then people would be asking why that particular choice had been made. And how to get the JVM to make some other choice. And why we couldn't have a system property that controlled which choice was made. And on and on. No, that keeps things simple.
Really there's no particular choice that is right in all situations. So why make a choice? Choosing a random thread is actually a pretty good procedure in a lot of cases, and for people who need some particular sequencing or prioritization, well, they can program that themselves.
SCJP 1.4 85%
Originally posted by Prateek Parekh:
Agreed, Paul. Leaving the choice of implementation to the programmer seems to provide more flexibility.
Originally posted by Preetha Arun:
what is arbitrary thread?
please explain me...
Thanks
Preetha
cmbhatt
SCJP 1.4 85%
Did you see how Paul cut 87% off of his electric heat bill with 82 watts of micro heaters? |