my dog learned polymorphism*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Thread Priority Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Thread Priority" Watch "Thread Priority" New topic
Author

Thread Priority

Mohit Agarwal
Ranch Hand

Joined: Mar 30, 2004
Posts: 88
According to K&B

" The closest thing to guarantee is that if a low priority thread is running when a high priority thread enters runnable the JVM will preempt the running low priority thread & put the high-priority thread in.

Can this fact be used while answering the SCJP1.4 Qs?

Mohit Agarwal
Would Be SCJP.

"The will to win is worthless if you do not have the will to prepare"
Barry Gaunt
Ranch Hand

Joined: Aug 03, 2002
Posts: 7729
Yes.
On a practical note however, the lower priority thread may possibly not be preempted immediately by a thread scheduler using time slices. The lower priority thread may be allowed to finish its time slice.


Ask a Meaningful Question and HowToAskQuestionsOnJavaRanch
Getting someone to think and try something out is much more useful than just telling them the answer.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Thread Priority
 
Similar Threads
atomic operation and Priority
priority doesn't show up in the output
priority
Threads - effect of sleep() on Thread priorities
thread's