HP-UX Processor Sets

HP-UX Processor Sets 19
# mpsched –c 1 –p 271
Pid 271: bound to processor 1
Multi-threaded applications based on the POSIX PTHREADS library can change the
processor set binding of a pthread using the pthread_pset_bind_np() library interface.
int
pthread_pset_bind_np(
psetid_t *answer, /* OUT: thread’s current pset*/
psetid_t pset, /* IN : new pset for thread */
pthread_t pthreadid /* IN : target pthread */
);
Destroying a Processor Set
The pset_destroy() system call allows users to destroy a processor set.
int
pset_destroy(
psetid_t pset /* IN: pset to be destroyed */
);
If pset is non-empty or has bound applications, then the PSET_ATTR_NONEMPTY
attribute’s value for the processor set determines its behavior. While the Default Pset cannot
be destroyed, users can destroy other processor sets using psrset as follows:
#psrset–d12
successfully destroyed pset 1
successfully destroyed pset 2
The following command will try to destroy all processor sets except the Default Pset if the
caller has appropriate permissions and the PSET_ATTR_NONEMPTY attribute for the
processor set allows the operation.
#psrset–dall
Querying and Changing Processor Set Attributes
The pset_getattr() system call allows users to query attibute values of a processor set.
int
pset_getattr (
psetid_t pset, /* IN : target pset */
pset_attrtype_t type, /* IN : which attribute */
pset_attrval_t* val/* OUT: current value of attr */
);
The pset_setattr() system call allows users to change the value of an attribute of a processor
set.
int
pset_setattr (
psetid_t pset, /* target pset */