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)
Scheduling Contention Scope
The scheduling contention scope defines the group of threads that a thread competes with for access to
resources. The contention scope is most often associated with access to a processor. However, this scope
may also be used when threads compete for other resources. Threads with the system scope compete for
access to resources with all other threads in the system. Threads with the process scope compete for access
to resources with other process scope threads in the process.
Scheduling Policy
A scheduling policy is a set of rules used to determine how and when multiple threads are scheduled to exe-
cute. The scheduling policy also determines how long a thread is allowed to execute.
Scheduling Priority
A scheduling priority is a numeric priority value assigned to threads in certain scheduling policies. Threads
with higher priorities are given preference when scheduling decisions are made.
Semaphore
A semaphore is similar to a mutex. A semaphore regulates access to one or more shared objects. A sema-
phore has a value associated with it. The value is generally set to the number of shared resources regulated
by the semaphore. When a semaphore has a value of one, it is a binary semaphore. A mutex is essentially a
binary semaphore. When a semaphore has a value greater than one, it is known as a counting semaphore.
A counting semaphore can be locked by multiple threads simultaneously. Each time the semaphore is
locked, the value is decremented by one. After the value reaches zero, new attempts to lock the semaphore
cause the locking thread to block until the semaphore is unlocked by another thread.
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 vari-
ables, 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.
Section 3−−642 − 12 − HP-UX Release 11i: December 2000
___
___