• 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:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

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.
 
Marshal
Posts: 7402
1423
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