HP-UX Reference (11i v2 04/09) - 2 System Calls (vol 5)
m
mpctl(2) mpctl(2)
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 initial 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, processors
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 proces-
sor 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 assign-
ment. 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 bind-
ing.
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 pro-
cess 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 bind-
ing.
MPC_SETLWP This call is advisory . This request asynchronously assigns LWP (lightweight
process) 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.
Section 2−−170 Hewlett-Packard Company − 4 − HP-UX 11i Version 2: September 2004