HP-UX Reference (11i v2 04/09) - 3 Library Functions N-Z (vol 7)
p
pthread(3T) pthread(3T)
(Pthread Library)
Shared Object
A shared object is a tangible entity that exists in the address space of a process and is accessible by all
threads within the process. In the context of multithreaded programming, "shared objects" are global
variables, file descriptors, and other such objects that require access by threads to be synchronized.
Signal
A signal is a simplified IPC mechanism that allows a process or thread to be notified of an event. Signals
can be generated synchronously and asynchronously.
Signal Mask
A signal mask determines which signals a thread accepts and which ones are blocked from delivery. If a
synchronous signal is blocked from delivery, it is held pending until either the thread unblocks the signal
or the thread terminates. If an asynchronous signal delivered to the process is blocked from delivery by a
thread, the signal may be handled by a different thread in the process that does not have the signal
blocked.
Signal Vector
A signal vector is a table contained in each process that describes the action that should be taken when a
signal is delivered to a thread within the process. Each signal has one of three potential behaviors:
ignore the signal, execute a signal-handling function, or perform the default action of the signal (usually
process termination).
Single-Threaded
means that there is only one flow of control (one thread) through the program code; only one instruction is
executed at a time.
Spinlock
A synchronization primitive similar to a mutex. If the lock cannot be acquired, instead of blocking, the
thread wishing to acquire the lock spins in a loop until the lock can be acquired. Spinlocks can be easily
used improperly and can severely degrade performance if used on a single processor system.
Spurious Wakeup
A spurious wakeup occurs when a thread is incorrectly unblocked, even though the event it was waiting
for has not occurred. A condition wait that is interrupted and returns because the blocked thread
received a normal signal is an example of a spurious wakeup.
Stack
A stack is used by a thread to make function calls (and return from those calls), to pass arguments to a
function call, and to create the space for local variables when in that function call. Bound threads have a
user stack and a kernel stack. Unbound threads have only a user stack.
Synchronous Signal
A synchronous signal is a signal that has been generated due to some action of a specific thread. For
example, when a thread does a divide by zero, causes a floating point exception, or executes an illegal
instruction, a signal is generated synchronously. Synchronous signals are delivered to the thread that
caused the signal to be sent.
Traditional Process
This is a single-threaded entity that can be scheduled to execute on a processor.
Thread
A thread is an independent flow of control within a process, composed of a context (which includes a
register set and program counter) and a sequence of instructions to execute.
Thread Local Storage (TLS)
Thread local storage is essentially thread-specific data requiring support from the compilers. With TLS,
an application can allocate the actual data as thread-specific data rather than using thread-specific data
keys. Additionally, TLS does not require the thread to make a function call to obtain thread-specific data.
The thread can access the data directly.
Thread-Safe Function
A thread-safe function is one that may be safely called by multiple threads at the same time. If the func-
tion accesses shared data or resources, this access is regulated by a mutex or some other form of
HP-UX 11i Version 2: September 2004 − 11 − Hewlett-Packard Company Section 3−−751