| ||||
Copyright 1999 Sams Publishing |
|
Thread Priority Constants |
There are three public static final int member variables of Thread that indicate the range of priority values that can be passed to setPriority() . These constants should be used to determine the range of acceptable priorities. |
Thread.MAX_PRIORITY |
Thread.MAX_PRIORITY is the highest thread-scheduling priority that can be passed to setPriority() for a particular VM. Generally, it is 10 . Threads running at this level might hog the processor and should be designed to block frequently to give other threads a chance to run. |
Thread.MIN_PRIORITY |
Thread.MIN_PRIORITY is the lowest thread-scheduling priority that can be passed to setPriority() for a particular VM. Generally, it is 1 . Threads running at this priority might not get much processor time and might not get any if there are other higher-priority threads running. |
Thread.NORM_PRIORITY |
Thread.NORM_PRIORITY is a not-too-high, not-too-low thread-scheduling priority for setPriority() . Generally, it is 5 . Threads running at this priority usually get a chance to run without hogging the processor. |
| |||
Toc |