Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Thread Priority

 
Vivek Nidhi
Ranch Hand
Posts: 133
  • Mark post as helpful
  • send pies
  • 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 ]
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13074
6
  • Mark post as helpful
  • send pies
  • 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
 
Vishy Karl
Ranch Hand
Posts: 116
  • Mark post as helpful
  • send pies
  • 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??
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic