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_processor_bind_np(3T) pthread_processor_bind_np(3T)
(Pthread Library)
The ldom parameter specifies the new locality domain binding for tid. The value
PTHREAD_LDOMNOCHANGE_NP may be passed to only read the current assignment. The value
PTHREAD_LDOMFLOAT_NP may be passed to break any specific locality domain assignment and allow
the implementation to choose which locality domain the thread should execute in. This allows the thread to
run on any processor the implementation chooses. Otherwise, ldom specifies the ID of the locality domain
to which tid should be bound to.
The locality domain bindingwill take precedence over the scheduling policy. For example, when a processor
is ready to choose another thread to execute, if the highest priority SCHED_FIFO thread on the run queue
is bound to a different locality domain, that thread will not be chosen by the available processor. That
thread will wait until a processor in the wanted locality domain becomes available. The available processor
will choose a lower priority thread to execute instead of completely honoring the scheduling policies.
RETURN VALUE
pthread_num_processors_np() always returns the number of processors on the system. It never
fails.
pthread_num_ldoms_np() always returns the number of locality domains on the system. It never
fails.
Upon successful completion, pthread_processor_id_np()
, pthread_ldom_id_np()
,
pthread_spu_to_ldom_np()
, pthread_num_ldomprocs_np(),
pthread_processor_bind_np()
, and pthread_ldom_bind_np() return zero. Otherwise, an
error number is returned to indicate the error (the
errno variable is not set).
Note: In some cases, pthread_processor_bind_np()
and pthread_ldom_bind_np()
may
return a negative value, other than -1, in the
answer field which still indicates a successful return. Refer
to mpctl(2) for the definition of the returned value.
ERRORS
If any of the following occur, the pthread_processor_id_np()
, pthread_ldom_id_np()
,
pthread_spu_to_ldom_np()
, pthread_num_ldomprocs_np(),
pthread_processor_bind_np()
, and pthread_ldom_bind_np() functions return the
corresponding error number:
[EINVAL] The request parameter contains an illegal value.
[EINVAL] The spu or ldom parameter contains an invalid ID.
[EINVAL] The request parameter is
PTHREAD_GETNEXTSPU_NP
and spu identifies the last
processor.
[EINVAL] The request parameter is
PTHREAD_GETNEXTLDOM_NP
and ldom identifies the last
locality domain.
[EINVAL] The value specified by answer is illegal.
[ESRCH] No thread could be found in the current process that matches the thread ID specified
in tid.
[EPERM] request is
PTHREAD_BIND_ADVISORY_NP or PTHREAD_BIND_ADVISORY_NP,
spu is not PTHREAD_SPUNOCHANGE_NP
, and the caller does not have the appropri-
ate permission to change a threads binding to a specific processor.
AUTHOR
pthread_num_processors_np()
, pthread_num_ldoms_np(),
pthread_num_ldomprocs_np()
, pthread_spu_to_ldom_np()
,
pthread_processor_id_np(), pthread_ldom_id_np()
,
pthread_processor_bind_np(), and pthread_ldom_bind_np()
were developed by HP.
SEE ALSO
sleep(3C), rtsched(2), mpctl(2).
STANDARDS CONFORMANCE
pthread_num_processors_np(): None.
pthread_num_ldoms_np()
: None.
pthread_num_ldomprocs_np()
: None.
pthread_spu_to_ldom_np()
: None.
Section 3708 4 HP-UX Release 11i: December 2000
___
___