HP-UX Reference (11i v3 07/02) - 2 System Calls (vol 5)
m
mpctl(2) mpctl(2)
However, if any LWP belongs to a different processor set such that the specified processor or locality
domain does not contribute to that processor set, the binding assignment for such an LWP is not changed.
When a process creates another process (via fork()
or vfork()), the child process will inherit the
parent process’s binding assignments (NOT the binding assignments of the creating LWP). The initial LWP
in the child process shall inherit its binding assignments from the child process. LWPs other than the ini-
tial LWP shall inherit their binding assignments from the creating LWP (unless specified otherwise in the
LWP create attributes).
Processor binding and locality domain binding are mutually exclusive -- only one can be in effect at any
time. If locality domain binding is in effect, the target is allowed to execute on any processor within that
locality domain in its processor set.
Setting the processor or locality domain binding will fail if the target processor or locality domain is not in
the processor set of the specified process or LWP.
WARNING: Due to the capability of online addition and deletion of processors on some platforms, proces-
sors may go away. If this occurs, any processes or LWPs bound to a departing processor will be rebound to
a different processor with the same binding type. If the last processor in a locality domain is removed, any
processes or LWPs bound to a departing locality domain will be rebound to a different locality domain.
For processor binding use:
int mpctl(mpc_request_t request, spu_t spu, pid_t pid);
int mpctl(mpc_request_t request, spu_t spu, lwpid_t lwpid);
The request argument determines the precise action to be taken by mpctl() and is one of the following:
MPC_SETPROCESS
This call is advisory. This request asynchronously assigns process pid to processor
spu. The new processor assignment is returned.
The pid
MPC_SELFPID may be used to refer to the calling process.
The spu MPC_SPUNOCHANGE
may be passed to read the current assignment.
The spu
MPC_SPUFLOAT may be used to break any specific-processor assignment.
This allows the process to float to any processor.
NOTE: This call is advisory . If the scheduling policy for a process conflicts with
this processor assignment, the scheduling policy takes precedence. For example,
when a processor is ready to choose another process to execute, and the highest
priority SCHED_FIFO process is bound to a different processor, that process will
execute on the selecting processor rather than waiting for the specified processor to
which it was bound.
If the process specified by pid is a multithreaded process, all LWPs (lightweight
processes) in the target process with the same processor set binding as the target
process will have their processor assignment changed to what is specified. The
processor set binding takes precedence over processor or locality domain binding.
MPC_SETPROCESS_FORCE
This call is identical to MPC_SETPROCESS except that the processor binding will
take precedence over the scheduling policy. This call is synchronous. For example,
when a processor is ready to choose another process to execute, and the highest
priority SCHED_FIFO process is bound to a different processor, that process will
not be selected to execute on the selecting processor, but instead wait for the
specified processor to which it was bound. The selecting processor will then choose
a lower priority process to execute on the processor.
NOTE: This option will not guarantee compliance with POSIX real-time schedul-
ing algorithms.
If the process specified by pid is a multithreaded process, all LWPs (lightweight
processes) in the target process with the same processor set binding as the target
process will have their processor assignment changed to what is specified. The
processor set binding takes precedence over processor or locality domain binding.
MPC_SETLWP This call is advisory. This request asynchronously assigns LWP (lightweight pro-
cess) lwpid to processor spu. The new processor assignment is returned. This
option is only available to change the assignment for LWPs in the current process.
HP-UX 11i Version 3: February 2007 − 5 − Hewlett-Packard Company 217