aspose file tools*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Thread Priority Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Thread Priority" Watch "Thread Priority" New topic
Author

Thread Priority

Vivek Nidhi
Ranch Hand

Joined: Aug 10, 2003
Posts: 133
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

Joined: Mar 22, 2000
Posts: 12681
    
    5
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


Java Resources at www.wbrogden.com
Vishy Karl
Ranch Hand

Joined: Sep 08, 2003
Posts: 116
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??


"The man who can drive himself further once the effort gets painful is the man who will win." <br />Roger Bannister
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Thread Priority
 
Similar Threads
Threads
threads and priority - guarenteed?
Cause a thread to stop
Threads & Interrupt Method...
Marcus Green mock exam - 2 #24