HP-UX Reference (11i v1 00/12) - 3 Library Functions N-Z (vol 7)
__________________________________________________________________________________________________________________________________________________________________________________________________
__________________________________________________________________________________________________________________________________________________________________________________________________
STANDARD Printed by: Nora Chuang [nchuang] STANDARD
/build/1111/BRICK/man3/nan.3m
________________________________________________________________
___ ___
p
pthread(3T) pthread(3T)
(Pthread Library)
Condition Variable
A condition variable is a synchronization primitive used to allow a thread to wait for an event. Condition
variables are often used in producer-consumer problems where a producer must provide something to one
or more consumers.
Context Switch
The act of removing the currently running thread from the processor and running another thread. A con-
text switch saves the register state of the currently running thread and restores the register state of the
thread chosen to execute next.
Critical Section
A section of code that must complete atomically and uninterrupted. A critical section of code is generally
one in which some global resource (variables, data structures, linked lists, etc.) is modified. The operation
being performed must complete atomically so that other threads do not see the critical section in an incon-
sistent state.
Deadlock
A deadlock occurs when one or more threads can no longer execute. For example, thread A holds lock 1 and
is blocked on lock 2. Meanwhile, thread B holds lock 2 and is blocked on lock 1. Threads A and B are per-
manently deadlocked. Deadlocks can occur with any number of resource holding threads. An interactive
deadlock involves two or more threads. A recursive (or self) deadlock involves only one thread.
Detached Thread
A thread whose resources are automatically released by the system when the thread terminates. A
detached thread cannot be joined by another thread. Consequently, detached threads cannot return an exit
status.
Joinable Thread
A thread whose termination can be waited for by another thread. Joinable threads can return an exit status
to a joining thread. Joinable threads maintain some state after termination until they are joined by another
thread.
Kernel Mode
A mode of operation where all operations are allowed. While a thread is executing a system call it is execut-
ing in kernel mode.
Kernel Space
The kernel program exists in this space. Kernel code is executed in this space at the highest privilege level.
In general, there are two privilege levels: one for user code (user mode) and the other for kernel code (ker-
nel mode).
Kernel Stack
When a thread makes a system call, it executes in kernel mode. While in kernel mode, it does not use the
stack allocated for use by the application. Instead, a separate kernel stack is used while in the system call.
Each kernel-scheduled entity, whether a process, kernel thread or lightweight process, contains a kernel
stack. See Stack for a generic description of a stack.
Kernel Thread
Kernel threads are created by the thread functions in the threads library. Kernel threads are kernel-
scheduled entities that are visible to the operating system kernel. A kernel thread typically supports one or
more user threads. Kernel threads execute kernel code or system calls on behalf of user threads. Some sys-
tems may call the equivalent of a kernel thread a lightweight process. See Thread for a generic description
of a thread.
Lightweight Process
A kernel-scheduled entity. Some systems may call the equivalent of a lightweight process a kernel thread.
Each process contains one or more lightweight process. How many lightweight processes a process contains
depends on whether and how the process is multithreaded. See Thread for a generic description of a
thread.
Section 3−−640 − 10 − HP-UX Release 11i: December 2000
___
___