Basic HTML version of Foils prepared 17 Nov 97

Foil 9 Thread Priorities and Groups

From Java Tutorial, July 1, 1996 CEWES Tutorial, CPS606, JSU Class CSC499 -- July 22-25 1997, Fall 97. by Nancy J. McCracken,Geoffrey C. Fox, Tom Scavo


Every thread has a priority, which can be set by the user with setPriority( int ) using constants MIN_PRIORITY (1), MAX_PRIORITY(10), or NORM_PRIORITY.
Whenever the thread scheduler picks a thread to run, it picks the highest priority thread that is currently runnable. (If there is more than one thread with the same priority, each thread gets a turn in some order.)
The user can also create a ThreadGroup to organize a large number of threads by functionality. The methods stop(), suspend(), and resume() can be used on a ThreadGroup.



© Northeast Parallel Architectures Center, Syracuse University, npac@npac.syr.edu

If you have any comments about this server, send e-mail to webmaster@npac.syr.edu.

Page produced by wwwfoil on Wed Apr 1 1998