1PTHREAD_ATTR_SETSCHEDPARAM(3L)inux Programmer's ManuPaTlHREAD_ATTR_SETSCHEDPARAM(3)
2
3
4

NAME

6       pthread_attr_setschedparam, pthread_attr_getschedparam - set/get sched‐
7       uling parameter attributes in thread attributes object
8

SYNOPSIS

10       #include <pthread.h>
11
12       int pthread_attr_setschedparam(pthread_attr_t *attr,
13                                      const struct sched_param *param);
14       int pthread_attr_getschedparam(pthread_attr_t *attr,
15                                      struct sched_param *param);
16
17       Compile and link with -pthread.
18

DESCRIPTION

20       The pthread_attr_setschedparam() function sets the scheduling parameter
21       attributes of the thread attributes object referred to by thread to the
22       values specified in the buffer pointed to by param.   These  attributes
23       determine  the  scheduling  parameters  of  a  thread created using the
24       thread attributes object attr.
25
26       The  pthread_attr_getschedparam()  returns  the  scheduling   parameter
27       attributes  of  the thread attributes object attr in the buffer pointed
28       to by param.
29
30       Scheduling parameters are maintained in the following structure:
31
32           struct sched_param {
33               int sched_priority;     /* Scheduling priority */
34           };
35
36       As can be seen,  only  one  scheduling  parameter  is  supported.   For
37       details  of  the  permitted  ranges  for  scheduling priorities in each
38       scheduling policy, see sched_setscheduler(2).
39

RETURN VALUE

41       On success, these functions return 0; on error, they return a  non-zero
42       error number.
43

ERRORS

45       POSIX.1  documents EINVAL and ENOTSUP errors for pthread_attr_setsched‐
46       param().  On Linux these functions always  succeed  (but  portable  and
47       future-proof  applications  should nevertheless handle a possible error
48       return).
49

CONFORMING TO

51       POSIX.1-2001.
52

EXAMPLE

54       See pthread_setschedparam(3).
55

NOTES

57       See pthread_attr_setschedpolicy(3) for a list of the thread  scheduling
58       policies supported on Linux.
59

SEE ALSO

61       sched_get_priority_min(2), sched_setscheduler(2), pthread_attr_init(3),
62       pthread_attr_setinheritsched(3),        pthread_attr_setschedpolicy(3),
63       pthread_create(3),  pthread_setschedparam(3),  pthread_setschedprio(3),
64       pthreads(7)
65

COLOPHON

67       This page is part of release 3.22 of the Linux  man-pages  project.   A
68       description  of  the project, and information about reporting bugs, can
69       be found at http://www.kernel.org/doc/man-pages/.
70
71
72
73Linux                             2008-11-17     PTHREAD_ATTR_SETSCHEDPARAM(3)
Impressum