Determining the Current Priority: getPriority()

Chapter 6 - Thread Prioritization

Java Thread Programming
Paul Hyde
  Copyright 1999 Sams Publishing

Summary
In this chapter I showed you how to use a few more parts of the Thread API:
  Thread.MAX_PRIORITY , Thread.NORM_PRIORITY , and Thread.MIN_PRIORITY
  getPriority()
  setPriority()
  Thread.yield()
The thread scheduler chooses which thread to move from the ready-to-run state to the running state. Thread priorities provide suggestions to the scheduler to help it pick the next thread to run. Generally, higher-priority threads get more processor time than lower-priority threads.
Thread scheduling varies from VM to VM and from operating system to operating system. Because of these differences, prioritization should only be used to try to improve responsiveness and efficiency, and should not be relied upon for program correctness.

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