aspose file tools*
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 Soft Skills this week in the Jobs Discussion 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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Thread Priority