Basic HTML version of Foils prepared Sept 21 1998

Foil 6 Thread Execution and Concurrency

From Java Tutorial 98- 4: Multi-Treading, Useful Java Classes, I/O and Networking NAVO Tutorial -- Sept 23 1998. by Geoffrey C. Fox, Nancy McCracken


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 on one cpu: Each thread gives up execution voluntarily (by executing yield(), suspend(), etc.) or because its time slice has ended:
Thread A
Thread B



© 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 Sat Nov 28 1998