• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

thread priority

 
Ranch Hand
Posts: 270
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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?
 
Ranch Hand
Posts: 1865
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
reply
    Bookmark Topic Watch Topic
  • New Topic