• 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 question

 
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi guys,
I have a quick question about thread priorities, it is saying that "the runnning thread will be of equal or greater priority than the highest priority threads in the pool", my question is, if the scheduler give the control to some thread and during that time slot some other thread's priority value is bumped to be higher than the current running thread, is the control immediately returned from the running thread back to the scheduler or the thread will finish the current time slot allocated to it and then return the control to the scheduler?
Thanks.
 
Sheriff
Posts: 7142
1364
IntelliJ IDE jQuery Eclipse IDE Postgres Database Tomcat Server Chrome Google App Engine
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Men Gumani wrote:... or the thread will finish the current time slot allocated to it and then return the control to the scheduler?



Yes it is.
Anyway you do NOT need to understand the behavior of the scheduler IN DEPTH for the SCJP exam. If you need to discuss further, you could use the Java intermediate forum.

Devaka
 
Men Gumani
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks, Devaka. I don't want to dig deep into the details, I am just curious about the statement in the book "at any given time the current running thread usually will not have a priority that is lower than any of the thread in the pool" is not completely right since even the priority of the running thread is changed to be lower than some of the threads' in the pool, as long as the time slot is not expiring, the current running thread will not return the control back to the scheduler and it is running with a lower priority than some thread in the pool.
Please forgive my ignorance.
reply
    Bookmark Topic Watch Topic
  • New Topic