1PTHREAD_ATTR_SETSCHEDPOLICY(L3i)nux Programmer's ManPuTaHlREAD_ATTR_SETSCHEDPOLICY(3)
2
3
4

NAME

6       pthread_attr_setschedpolicy,   pthread_attr_getschedpolicy   -  set/get
7       scheduling policy attribute in thread attributes object
8

SYNOPSIS

10       #include <pthread.h>
11
12       int pthread_attr_setschedpolicy(pthread_attr_t *attr, int policy);
13       int pthread_attr_getschedpolicy(pthread_attr_t *attr, int *policy);
14
15       Compile and link with -pthread.
16

DESCRIPTION

18       The pthread_attr_setschedpolicy() function sets the  scheduling  policy
19       attribute  of  the  thread attributes object referred to by attr to the
20       value specified in policy.  This attribute  determines  the  scheduling
21       policy of a thread created using the thread attributes object attr.
22
23       The   supported   values  for  policy  are  SCHED_FIFO,  SCHED_RR,  and
24       SCHED_OTHER, with the semantics described in sched_setscheduler(2).
25
26       The  pthread_attr_getschedpolicy()  returns   the   scheduling   policy
27       attribute of the thread attributes object attr in the buffer pointed to
28       by policy.
29
30       In order for the policy setting made  by  pthread_attr_setschedpolicy()
31       to  have  effect  when  calling  pthread_create(3), the caller must use
32       pthread_attr_setinheritsched(3) to set the inherit-scheduler  attribute
33       of the attributes object attr to PTHREAD_EXPLICIT_SCHED.
34

RETURN VALUE

36       On  success,  these functions return 0; on error, they return a nonzero
37       error number.
38

ERRORS

40       pthread_attr_setschedpolicy() can fail with the following error:
41
42       EINVAL Invalid value in policy.
43
44       POSIX.1-2001 also documents an optional  ENOTSUP  error  ("attempt  was
45       made   to   set   the   attribute   to   an   unsupported  value")  for
46       pthread_attr_setschedpolicy().
47

CONFORMING TO

49       POSIX.1-2001.
50

EXAMPLE

52       See pthread_setschedparam(3).
53

SEE ALSO

55       sched_setscheduler(2), pthread_attr_init(3),
56       pthread_attr_setinheritsched(3), pthread_attr_setschedparam(3),
57       pthread_create(3), pthread_setschedparam(3), pthread_setschedprio(3),
58       pthreads(7)
59

COLOPHON

61       This page is part of release 3.53 of the Linux man-pages project.  A
62       description of the project, and information about reporting bugs, can
63       be found at http://www.kernel.org/doc/man-pages/.
64
65
66
67Linux                             2013-06-21    PTHREAD_ATTR_SETSCHEDPOLICY(3)
Impressum