Next: Virtual Memory
Up: Running Topaz Applications on
Previous: C Library
On Taos, thread scheduling is done at the lowest level of the system (in
the Nub) However, on Ultrix scheduling is done at two levels. The Ultrix
kernel schedules processes as single-threaded entities, while the Ultrix
Topaz library multiplexes a single-threaded Ultrix process to provide a
multithreaded Topaz process.
The Ultrix implementation of Topaz implements nearly the full range of
functions in the Thread, ThreadFriends, ThreadFriends1, ThreadsPort,
TPFriends, and TPSpecial interfaces. The main omissions are the
procedures dealing with other address spaces and the `Directed' procedures
(intended for use by debugging facilities).
The main observable differences in the Ultrix implementation are:
-
Thread priorities are observed, but there is no time-slicing between
threads at the same priority within a process. (Of course, the Ultrix
kernel continues to perform time-slicing between separate Ultrix
processes.)
- In some cases when a thread performs I/O on a device or socket there will
be scheduling anomalies. A write to a terminal can block all the threads
in a process if the output buffer for the terminal is full (this does not
hold for the master side of a pseudo terminal). A read or write of a
socket or device that doesn't support asynchronous mode (SigIO) may wait
for up to .5 second of CPU time to be used by lower-priority compute-bound
threads in the process.
- Per-thread CPU time (as reported by TPSpecial.GetCPUTime) is not normally
recorded. However, linking the object file
/proj/ultrix/lib/enable_times.o into an Ultrix Topaz application causes
per-thread CPU times to be recorded (at the cost of slowing down context
switches by a factor of two). The CPU times so recorded include time
spent in the Ultrix kernel on behalf of the thread as well as overhead for
thread switching and signal handling.
Next: Virtual Memory
Up: Running Topaz Applications on
Previous: C Library
Paul McJones
8/28/1997