• 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

Time slicing or round ribbon??

 
Ranch Hand
Posts: 135
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hey SCJP's
I have question .
1)Do the questions asked in SCJP r platfrom dependent???
What i mean to say that if they ask
a)A low priority thread never gets to execute if a higher priority thread is been excuted T/F
According to me if the os is using time slicing to manage proccessor than it will get some time eventually .if it's using pre-emptive scheduling to manage proccessor it will not be excuted till higher priority thread is through.
Am i right ??

Regards
Denish
 
"The Hood"
Posts: 8521
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
They are very careful to word the questions so that there is no possibility of 2 interpretations of the question. If there is something that is OS dependant, then the answers reflect that in the wording.
 
Enthuware Software Support
Posts: 4803
52
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Java specification goes to great lengths in avoiding saying things that could be potentially platform dependent.
Threading is an area which is hingly platform dependent. As 'CPU allocation' to threads is platform dependent, the specification does not guatantee which thread should get scheduled when. By not commiting to such behaviour, the specification itself remains fairly platform independent.
The point is, answers to questions like this are NOT platform dependent.
The statement, "A low priority thread never gets to execute if a higher priority thread is been executed." is false not because Win32 doesn't do so but because the language specification doesn't guarantee it.
Similarly an exactly opposite statement, "A low priority thread will get to execute even if a higher priority thread is been excuted." is also false. Not because solaris doesn't do so but because the spec. doesn't guarantee it.
Another classic example is about Garbage collection. In all the JVMs (at least that I know of!), the GC thread runs in low memory conditions. But still the statement, "GC thread runs in low memory conditions" is false. Simply because the spec. doesn't guarantee it.
So, whenever you get such question do not panic. Either, as Cindy said, it will be very clear that the question is asking about a particular platform (ex. On Solaris a low priority thread never gets to execute if a higher priority thread is been executed.) or the answer can really by given in platform independent way if you understand the concepts well.
HTH,
Paul.
------------------
Get Certified, Guaranteed!
(Now Revised for the new Pattern)
www.enthuware.com/jqplus

Try out the world's only WebCompiler!
www.jdiscuss.com
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic