HP-UX Reference (11i v2 03/08) - 3 Library Functions N-Z (vol 7)
p
pthread(3T) pthread(3T)
(Pthread Library)
synchronization.
Thread-Specific Data (TSD)
Thread-specific data is global data that is specific to a thread. All threads access the same data variable.
However, each thread has its own thread-specific value associated with this variable. errno is an example
of thread-specific data.
Thread Structure
The operating system maintains a thread structure for each thread in the system. This structure
represents the actual thread internally in the system. A sample of thread structure information includes
the thread ID, the scheduling policy and priority, and the signal mask. The thread structure and the
values contained within it are part of the context of a thread.
User Mode
A mode of operation where a subset of operations are allowed. While a thread is executing an applica-
tions code, it is executing in user mode. When the thread makes a system call, it changes modes and exe-
cutes in kernel mode until the system call completes.
User Space
The user code exists in this space. User code is executed in this space at the normal privilege level. In
general, there are two privilege levels: one for user code (user mode) and the other for kernel code (kernel
mode).
User Stack
When a thread is executing code in user space, it needs to use a stack to make function calls, pass param-
eters, and create local variables. While in user mode, a thread does not use the kernel stack. Instead, a
separate user stack is allocated for use by each user thread. See Stack for a generic description of a
stack.
User Thread
When
pthread_create()
is called, a user thread is created. Whether a kernel-scheduled entity (ker-
nel thread or lightweight process) is also created depends on the user thread’s scheduling contention
scope. When a bound thread is created, both a user thread and a kernel-scheduled entity are created.
When an unbound thread is created, generally only a user thread is created. See Thread for a generic
description of a thread.
SEE ALSO
thread_safety(5).
ThreadTime by Scott J. Norton and Mark D. DiPasquale, Prentice-Hall, ISBN 0-13-190067-6, 1996.
HP-UX 11i Version 2: August 2003 − 12 − Hewlett-Packard Company Section 3−−735