1PTHREAD_SETSCHEDPRIO(3P)   POSIX Programmer's Manual  PTHREAD_SETSCHEDPRIO(3P)
2
3
4

PROLOG

6       This  manual  page is part of the POSIX Programmer's Manual.  The Linux
7       implementation of this interface may differ (consult the  corresponding
8       Linux  manual page for details of Linux behavior), or the interface may
9       not be implemented on Linux.
10

NAME

12       pthread_setschedprio -  dynamic  thread  scheduling  parameters  access
13       (REALTIME THREADS)
14

SYNOPSIS

16       #include <pthread.h>
17
18       int pthread_setschedprio(pthread_t thread, int prio);
19
20

DESCRIPTION

22       The  pthread_setschedprio()  function shall set the scheduling priority
23       for the thread whose thread ID is given by thread to the value given by
24       prio.  See  Scheduling  Policies for a description on how this function
25       call affects the ordering of the thread in the thread list for its  new
26       priority.
27
28       If  the  pthread_setschedprio() function fails, the scheduling priority
29       of the target thread shall not be changed.
30

RETURN VALUE

32       If successful, the pthread_setschedprio() function shall  return  zero;
33       otherwise, an error number shall be returned to indicate the error.
34

ERRORS

36       The pthread_setschedprio() function may fail if:
37
38       EINVAL The  value  of  prio is invalid for the scheduling policy of the
39              specified thread.
40
41       ENOTSUP
42              An attempt was made to set the priority to an unsupported value.
43
44       EPERM  The caller does not have the appropriate permission to  set  the
45              scheduling policy of the specified thread.
46
47       EPERM  The  implementation does not allow the application to modify the
48              priority to the value specified.
49
50       ESRCH  The value specified by thread does  not  refer  to  an  existing
51              thread.
52
53
54       The  pthread_setschedprio()  function shall not return an error code of
55       [EINTR].
56
57       The following sections are informative.
58

EXAMPLES

60       None.
61

APPLICATION USAGE

63       None.
64

RATIONALE

66       The pthread_setschedprio() function provides a way for  an  application
67       to temporarily raise its priority and then lower it again, without hav‐
68       ing the undesired side effect of yielding to other threads of the  same
69       priority.  This is necessary if the application is to implement its own
70       strategies for bounding priority inversion, such  as  priority  inheri‐
71       tance or priority ceilings.  This capability is especially important if
72       the implementation does not support the Thread Priority  Protection  or
73       Thread Priority Inheritance options, but even if those options are sup‐
74       ported it is needed if the application is to bound priority inheritance
75       for other resources, such as semaphores.
76
77       The  standard  developers  considered that while it might be preferable
78       conceptually to solve this problem by modifying  the  specification  of
79       pthread_setschedparam(),  it  was  too  late  to make such a change, as
80       there may be implementations that would need to be changed.  Therefore,
81       this new function was introduced.
82

FUTURE DIRECTIONS

84       None.
85

SEE ALSO

87       Scheduling Policies, pthread_getschedparam(), the Base Definitions vol‐
88       ume of IEEE Std 1003.1-2001, <pthread.h>
89
91       Portions of this text are reprinted and reproduced in  electronic  form
92       from IEEE Std 1003.1, 2003 Edition, Standard for Information Technology
93       -- Portable Operating System Interface (POSIX),  The  Open  Group  Base
94       Specifications  Issue  6,  Copyright  (C) 2001-2003 by the Institute of
95       Electrical and Electronics Engineers, Inc and The Open  Group.  In  the
96       event of any discrepancy between this version and the original IEEE and
97       The Open Group Standard, the original IEEE and The Open Group  Standard
98       is  the  referee document. The original Standard can be obtained online
99       at http://www.opengroup.org/unix/online.html .
100
101
102
103IEEE/The Open Group                  2003             PTHREAD_SETSCHEDPRIO(3P)
Impressum