Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

thr_getprio(3c) [opensolaris man page]

thr_getprio(3C) 					   Standard C Library Functions 					   thr_getprio(3C)

NAME
thr_getprio, thr_setprio - access dynamic thread scheduling SYNOPSIS
cc -mt [ flag... ] file...[ library... ] #include <thread.h> int thr_setprio(thread_t target_thread, int priority); int thr_getprio(thread_t target_thread, int *priority); DESCRIPTION
The thr_setprio() function sets the scheduling priority for the thread specified by target_thread within the current process to the value given by priority. The thr_getprio() function stores the current priority for the thread specified by target_thread in the location pointed to by priority. If the thr_setprio() function fails, the scheduling priority of the target thread is not changed. See priocntl(2), pthread_setschedprio(3C), and sched_setparam(3C). RETURN VALUES
If successful, the thr_getprio() and thr_setprio() functions return 0. Otherwise, an error number is returned to indicate the error. ERRORS
The thr_getprio() and thr_setprio() functions will fail if: ESRCH The value specified by target_thread does not refer to an existing thread. The thr_setprio() function will fail if: EINVAL The value of priority is invalid for the scheduling policy of the specified thread. EPERM The caller does not have the appropriate permission to set the priority to the value specified. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |MT-Level |MT-Safe | +-----------------------------+-----------------------------+ SEE ALSO
priocntl(2), pthread_setschedprio(3C), sched_setparam(3C), thr_create(3C), thr_suspend(3C), thr_yield(3C), attributes(5), standards(5) SunOS 5.11 1 Apr 2008 thr_getprio(3C)

Check Out this Related Man Page

PTHREAD_SETSCHEDPARAM(3)				     Library Functions Manual					  PTHREAD_SETSCHEDPARAM(3)

NAME
pthread_setschedparam, pthread_getschedparam - control thread scheduling parameters SYNOPSIS
#include <pthread.h> int pthread_setschedparam(pthread_t target_thread, int policy, const struct sched_param *param); int pthread_getschedparam(pthread_t target_thread, int *policy, struct sched_param *param); DESCRIPTION
pthread_setschedparam sets the scheduling parameters for the thread target_thread as indicated by policy and param. policy can be either SCHED_OTHER (regular, non-realtime scheduling), SCHED_RR (realtime, round-robin) or SCHED_FIFO (realtime, first-in first-out). param spec- ifies the scheduling priority for the two realtime policies. See sched_setpolicy(2) for more information on scheduling policies. The realtime scheduling policies SCHED_RR and SCHED_FIFO are available only to processes with superuser privileges. pthread_getschedparam retrieves the scheduling policy and scheduling parameters for the thread target_thread and store them in the loca- tions pointed to by policy and param, respectively. RETURN VALUE
pthread_setschedparam and pthread_getschedparam return 0 on success and a non-zero error code on error. ERRORS
On error, pthread_setschedparam returns the following error codes: EINVAL policy is not one of SCHED_OTHER, SCHED_RR, SCHED_FIFO EINVAL the priority value specified by param is not valid for the specified policy EPERM the calling process does not have superuser permissions ESRCH the target_thread is invalid or has already terminated EFAULT param points outside the process memory space On error, pthread_getschedparam returns the following error codes: ESRCH the target_thread is invalid or has already terminated EFAULT policy or param point outside the process memory space AUTHOR
Xavier Leroy <Xavier.Leroy@inria.fr> SEE ALSO
sched_setscheduler(2), sched_getscheduler(2), sched_getparam(2), pthread_attr_setschedpolicy(3), pthread_attr_setschedparam(3). LinuxThreads PTHREAD_SETSCHEDPARAM(3)
Man Page