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)
to one of those processors - these functions will return an error if that processor had been deleted).
Processor and locality domain IDs are not guaranteed to exist in numerical order. There may be holes in a
sequential list of IDs. Due to the capability of online addition and deletion of processors on some platforms,
processor and locality domain IDs obtained via these interfaces may be invalid at a later time. Likewise,
the number of processors and locality domains in the system may also change due to processors being
added or deleted.
DESCRIPTION
These functions provide a means of determining how many processors and locality domains are installed in
the system and assigning threads to run on specific processors or locality domains.
A locality domain consists of a related collection of processors, memory, and peripheral resources that
comprise a fundamental building block of the system. All processors and peripheral devices in a given local-
ity domain have equal latency to the memory contained within that locality domain.
Machine Topology Information
The pthread_num_processors_np() function returns the number of processors currently installed
on the system.
The pthread_num_ldoms_np()
function returns the number of locality domains currently installed on
the system.
The
pthread_num_ldomprocs_np()
function determines the number of processors currently
installed in the locality domain specified by ldom. The number of processors is returned in the answer
parameter.
The
pthread_processor_id_np()
function obtains the processor ID of a specific processor on the
system. The processor ID is returned in answer. The request parameter determines the precise action to be
taken and is one of the following:
PTHREAD_GETFIRSTSPU_NP
This request stores in the answer parameter the ID of the first processor in the system. The spu
argument is ignored.
PTHREAD_GETNEXTSPU_NP
This request stores in the answer parameter the ID of the next processor in the system after
spu.
Typically, PTHREAD_GETFIRSTSPU_NP
is called to determine the first spu.
PTHREAD_GETNEXTSPU_NP
is then called in a loop (until the call returns EINVAL) to deter-
mine the IDs of the remaining spus.
PTHREAD_GETCURRENTSPU_NP
This request stores in the answer parameter the ID of the processor the thread is currently run-
ning on. The spu argument is ignored. Note: This option returns the current processor on which
the caller is executing, NOT the processor assignment of the caller.
This information may be out-of-date arbitrarily soon after the call completes due to the scheduler
context switching the caller onto another processor.
The pthread_ldom_id_np()
function obtains the locality domain ID of a specific locality domain on
the system. The locality domain ID is returned in answer. The request parameter determines the precise
action to be taken and is one of the following:
PTHREAD_GETFIRSTLDOM_NP
This request stores in the answer parameter the ID of the first locality domain in the system.
The ldom argument is ignored.
PTHREAD_GETNEXTLDOM_NP
This request stores in the answer parameter the ID of the next locality domain in the system
after ldom.
Typically, PTHREAD_GETFIRSTLDOM_NP is called to determine the first ldom.
PTHREAD_GETNEXTLDOM_NP is then called in a loop (until the call returns EINVAL)to
determine the IDs of the remaining ldoms.
The
pthread_spu_to_ldom_np()
function returns the ID of the locality domain containing the pro-
cessor specified by spu. The locality domain ID is returned in ldom.
Section 3706 2 HP-UX Release 11i: December 2000
___
___