File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Thread.MIN_PRIORITY  and MAX_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.MIN_PRIORITY  and MAX_PRIORITY " Watch "Thread.MIN_PRIORITY  and MAX_PRIORITY " New topic
Author

Thread.MIN_PRIORITY and MAX_PRIORITY

RAGU KANNAN
Ranch Hand

Joined: Dec 16, 2005
Posts: 103
Hello Guru�s

Pls explain me for the following statement. It say�s
�The thread's priority the lower of the two priorities.�
I would like to know lower of which two priorities?

Thanks, Raghu.K


"If a thread's priority is set within the range of Thread.MIN_PRIORITY and Thread.MAX_PRIORITY but higher Than the thread group�s maximum priority, it will compile fine but in runtime the scheduling system will assign The thread's priority the lower of the two priorities."
Henry Wong
author
Sheriff

Joined: Sep 28, 2004
Posts: 18977
    
  40

The two priorities being referred to, are the priority of the thread, and the maximum priority of the thread group that the thread is assigned to. Basically, what the statement is pointing out is that the thread group will limit the thread priority of the threads in the group. Any thread with a priority, that is higher than the maximum, will be lowered to the maximum thread priority of the group.

Henry


Books: Java Threads, 3rd Edition, Jini in a Nutshell, and Java Gems (contributor)
 
Consider Paul's rocket mass heater.
 
subject: Thread.MIN_PRIORITY and MAX_PRIORITY