Next: 3.2.4 Multi-threaded Applications
Up: 3.2 Concurrency
Previous: 3.2.2 Processes vs. Threads
There are two distinct models of thread controls, and they are
user-level threads and kernel-level threads. The
thread function library to implement user-level threads usually runs on
top of the system in user mode. Thus, these threads within a process
are invisible to the operating system. User-level threads have extremely
low overhead, and can achieve high performance in computation. However,
using the blocking system calls like read(), the entire
process would block. Also, the scheduling control by the thread runtime
system may cause some threads to gain exclusive access to the CPU and prevent
other threads from obtaining the CPU. Finally, access to multiple
processors is not guaranteed since the operating system is not aware of
existence of these types of threads.
On the other hand, kernel-level threads
will guarantee multiple processor access but the computing performance is
lower than user-level threads due to load on the system. The synchronization
and sharing resources among threads are still less expensive than
multiple-process model, but more expensive than user-level threads. The
thread function library available today is often implemented as a
hybrid model, as having advantages from both user-level and kernel-level
threads. The design consideration of thread packages today consists of how
to minimize the system overhead while providing
access to the multiple processors [RR96].
Next: 3.2.4 Multi-threaded Applications
Up: 3.2 Concurrency
Previous: 3.2.2 Processes vs. Threads
Kiyoshi Kawaguchi
2000-06-17