pthread_setrunon_np(3P)

pthread_setrunon_np, pthread_getrunon_np - thread CPU scheduling affinity

As shipped in IRIX 6.5.7. Unchanged since IRIX 6.5.

NAME
     pthread_setrunon_np, pthread_getrunon_np - thread CPU scheduling affinity

C SYNOPSIS
     #include <pthread.h>

     int pthread_setrunon_np(int cpu);

     int pthread_getrunon_np(int *cur_cpu);

DESCRIPTION
     Executing threads run on the most eligible CPU determined by the kernel.
     This choice may be changed for threads with the PTHREAD_SCOPE_SYSTEM
     attribute using the pthread_setrunon_np() interface.  This interface
     requests that the calling thread execute exclusively on the named cpu.
     The CPU should be chosen in the same way as for sysmp() interface with
     the MP_MUSTRUN command.  To further control execution the MP_RESTRICT and
     MP_ISOLATE sysmp() commands can be used as usual.

     To determine the currently requested CPU affinity the
     pthread_getrunon_np() interface can be used.  It returns the the caller's
     CPU affinity (set by a previous call to pthread_setrunon_np()) in
     cur_cpu.

DIAGNOSTICS
     On success pthread_setrunon_np() and pthread_getrunon_np() return zero;
     otherwise an error number is returned.

     pthread_setrunon_np() may return:

     [EPERM]        The caller is not a PTHREAD_SCOPE_SYSTEM thread.

     [EINVAL]       The cpu argument is not valid.

     pthread_getrunon_np() may return:

     [EPERM]        The caller is not a PTHREAD_SCOPE_SYSTEM thread.

     [EINVAL]       The caller has no affinity set.

SEE ALSO
     pthread_attr_setscope(3P), sysmp(2).

NOTES
     The _np suffix indicates that this is a non-portable interface and is not
     covered by any standard.