Basic HTML version of Foils prepared 17 Nov 97

Foil 6 Thread Execution and Concurrency

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


Threads are implemented by a scheduler in Java, which asks the local operating system to run threads in the "runnable" state.
Typically, the OS runs each thread in turn for a "time slice". However, some operating systems (early versions of Solaris, e.g.) run a thread to completion unless another thread of higher priority preempts the running thread.
Example of two threads running: Each thread gives up execution voluntarily (by executing yield(), suspend(), etc.) or because its time slice has ended:



© 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