The Best Replacement for stop(), suspend(), and resume()

Chapter 6 - Thread Prioritization

Java Thread Programming
Paul Hyde
  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


Java Thread Programming
Java Thread Programming
ISBN: 0672315858
EAN: 2147483647
Year: 2005
Pages: 149
Authors: Paul Hyde

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net