• 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: 133
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can we say at a Given time, Thread in running state will always have higher prioriy than all the threads in the pool with ready state.
In short can we be sure that always higher priority Thread will be running.
I guess in some cases to prevent starvation Thread Scheduler may give a chance to lower proirity threads to run, holding higher priority threads
CAN SOME PLZ COMMENT ON IT
regs
Vivek Nidhi
[ December 06, 2003: Message edited by: Vivek Nidhi ]
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Can we say at a Given time, Thread in running state will always have higher prioriy than all the threads in the pool with ready state.


Certainly not - how a JVM partitions out CPU time to ready Threads is up to the JVM designer.
Bill
 
Ranch Hand
Posts: 116
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi William,
Sorry but I am having doubt on what you said. As it is given in the K&B book(PG 512) that
"
At any given time the currently running thread usually will not have a priority that is lower than any of the threads in the pool.
The running thread will be equal or greater priority than the highest running threads in the pool. This is as close a guarantee abt scheduling .........
So according to the above explanation the statement is true !!!
Any comments??
 
Not so fast naughty spawn! I want you to know about
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic