HP-UX Reference (11i v1 05/09) - 2 System Calls (vol 5)

m
mpctl(2) mpctl(2)
NAME
mpctl - multiprocessor control
SYNOPSIS
#include <sys/mpctl.h>
int mpctl(
mpc_request_t request,
spu_t spu,
pid_t pid
);
int mpctl(
mpc_request_t request,
spu_t spu,
lwpid_t lwpid
);
int mpctl(
mpc_request_t request,
ldom_t ldom,
pid_t pid
);
int mpctl(
mpc_request_t request,
ldom_t ldom,
lwpid_t lwpid
);
REMARKS
Much of the functionality of this capability is highly dependent on the underlying hardware. An application
that uses this system call should not be expected to be portable across architectures or implementations.
Some hardware platforms support online addition and deletion of processors. Due to this capability, proces-
sors and locality domains may be added or deleted while the system is running. Applications should be writ-
ten to handle processor IDs and locality domain IDs that dynamically appear or disappear (for example,
sometime after obtaining the IDs of all the processors in the system an application may try to bind an LWP
to one of those processors - this system call will return an error if that processor had been deleted).
Processor sets restrict application execution to designated group of processors. Some applications may
query information about processors and locality domains available to them, while other applications may
require system-wide information. The mpctl(2) interface supports two unique sets of command requests
for these purposes.
Applications using the pthread interfaces should not use this system call. A special set of pthread_*()
routines has been developed for use by pthread applications. See the pthread_processor_bind_np(3T)
manual page for information on these interfaces.
DESCRIPTION
mpctl provides a means of determining how many processors and locality domains are available in the
system, and assigning processes or lightweight processes to execute on specific processors or within a
specific locality domain.
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.
Processor sets provide an alternative application scheduling allocation domain. A processor set comprises
an isolated group of processors for exclusive use by applications assigned to the processor set. Applications
may use mpctl to query about processors and locality domains available for them to scale and optimize
accordingly. Use sysconf(2) with _SC_PSET_SUPPORT name to see if the processor set functionality
is enabled and available on the system.
mpctl call is expected to be used to increase performance in certain applications, but should not be used to
ensure correctness of an application. Specifically, cooperating processes/lightweight processes should not
rely on processor or locality domain assignment in lieu of a synchronization mechanism (such as
HP-UX 11i Version 1: September 2005 1 Hewlett-Packard Company Section 2167