1 .TH PTHREAD_SETSCHEDPARAM 3 LinuxThreads
3 .XREF pthread_getschedparam
6 pthread_setschedparam, pthread_getschedparam \- control thread scheduling parameters
11 int pthread_setschedparam(pthread_t target_thread, int policy, const struct sched_param *param);
13 int pthread_getschedparam(pthread_t target_thread, int *policy, struct sched_param *param);
17 !pthread_setschedparam! sets the scheduling parameters for the thread
18 |target_thread| as indicated by |policy| and |param|. |policy| can be
19 either !SCHED_OTHER! (regular, non-realtime scheduling), !SCHED_RR!
20 (realtime, round-robin) or !SCHED_FIFO! (realtime, first-in
21 first-out). |param| specifies the scheduling priority for the two
22 realtime policies. See !sched_setpolicy!(2) for more information on
25 The realtime scheduling policies !SCHED_RR! and !SCHED_FIFO! are
26 available only to processes with superuser privileges.
28 !pthread_getschedparam! retrieves the scheduling policy and scheduling
29 parameters for the thread |target_thread| and store them in the
30 locations pointed to by |policy| and |param|, respectively.
33 !pthread_setschedparam! and !pthread_getschedparam! return 0 on
34 success and a non-zero error code on error.
37 On error, !pthread_setschedparam! returns the following error codes:
41 |policy| is not one of !SCHED_OTHER!, !SCHED_RR!, !SCHED_FIFO!
45 the priority value specified by |param| is not valid for the specified policy
49 the calling process does not have superuser permissions
53 the |target_thread| is invalid or has already terminated
57 |param| points outside the process memory space
60 On error, !pthread_getschedparam! returns the following error codes:
64 the |target_thread| is invalid or has already terminated
68 |policy| or |param| point outside the process memory space
72 Xavier Leroy <Xavier.Leroy@inria.fr>
75 !sched_setscheduler!(2),
76 !sched_getscheduler!(2),
78 !pthread_attr_setschedpolicy!(3),
79 !pthread_attr_setschedparam!(3).