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
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "thread priority" Watch "thread priority" New topic
Author

thread priority

Yi Meng
Ranch Hand

Joined: May 07, 2003
Posts: 270
with reference to Dan's Thread exam 1 Q17
t1.setPriority(Thread.MIN_PRIORITY);
t2.setPriority(Thread.MAX_PRIORITY);
The answer given is "a.The priority assigned to thread T2 is greater than the priority assigned to T1.".
But to some single priority operating system all the threads will actually be the same priority.....and thus the answer should be "d. None of the above.". is it true? any comments?


Meng Yi
Dan Chisholm
Ranch Hand

Joined: Jul 02, 2002
Posts: 1865
The complete question is as follows.

Answer a.
The explanation is as follows.

The Java Language Specification suggests that higher priority threads should be given preference over lower priority threads but explicitly states that such preference is not a guarantee. It is very important to remember that no guarantee exists.

It is correct to say that the operating system is free to ignore the priority levels assigned to the Threads.


Dan Chisholm<br />SCJP 1.4<br /> <br /><a href="http://www.danchisholm.net/" target="_blank" rel="nofollow">Try my mock exam.</a>
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: thread priority