Manual Pages for Linux CentOS command on man pthread_attr_getschedparam
MyWebUniversity

Manual Pages for Linux CentOS command on man pthread_attr_getschedparam

PTHREADATTRSETSCHEDPARAM(Linux Programmer's ManPTHREADATTRSETSCHEDPARAM(3)

NAME

pthreadattrsetschedparam, pthreadattrgetschedparam - set/get sched‐ uling parameter attributes in thread attributes object SYNOPSIS

#include int pthreadattrsetschedparam(pthreadattrt *attr, const struct schedparam *param); int pthreadattrgetschedparam(pthreadattrt *attr, struct schedparam *param);

Compile and link with -pthread. DESCRIPTION The pthreadattrsetschedparam() function sets the scheduling parameter attributes of the thread attributes object referred to by attr to the values specified in the buffer pointed to by param. These attributes determine the scheduling parameters of a thread created using the thread attributes object attr. The pthreadattrgetschedparam() returns the scheduling parameter attributes of the thread attributes object attr in the buffer pointed to by param. Scheduling parameters are maintained in the following structure: struct schedparam { int schedpriority; /* Scheduling priority */ }; As can be seen, only one scheduling parameter is supported. For details of the permitted ranges for scheduling priorities in each scheduling policy, see schedsetscheduler(2). In order for the parameter setting made by pthreadattrsetschedparam() to have effect when calling pthreadcreate(3), the caller must use

pthreadattrsetinheritsched(3) to set the inherit-scheduler attribute of the attributes object attr to PTHREADEXPLICITSCHED. RETURN VALUE On success, these functions return 0; on error, they return a nonzero error number. ERRORS POSIX.1 documents EINVAL and ENOTSUP errors for pthreadattrsetsched‐ param(). On Linux these functions always succeed (but portable and

future-proof applications should nevertheless handle a possible error return). ATTRIBUTES For an explanation of the terms used in this section, see attributes(7). ┌──────────────────────────────┬───────────────┬─────────┐ │Interface │ Attribute │ Value │ ├──────────────────────────────┼───────────────┼─────────┤

│pthreadattrsetschedparam(), │ Thread safety │ MT-Safe │ │pthreadattrgetschedparam() │ │ │ └──────────────────────────────┴───────────────┴─────────┘ CONFORMING TO

POSIX.1-2001. NOTES See pthreadattrsetschedpolicy(3) for a list of the thread scheduling policies supported on Linux. EXAMPLE See pthreadsetschedparam(3). SEE ALSO schedgetprioritymin(2), schedsetscheduler(2), pthreadattrinit(3), pthreadattrsetinheritsched(3), pthreadattrsetschedpolicy(3), pthreadcreate(3), pthreadsetschedparam(3), pthreadsetschedprio(3), pthreads(7) COLOPHON

This page is part of release 3.53 of the Linux man-pages project. A description of the project, and information about reporting bugs, can

be found at http://www.kernel.org/doc/man-pages/.

Linux 2013-06-21 PTHREADATTRSETSCHEDPARAM(3)




Contact us      |      About us      |      Term of use      |       Copyright © 2000-2019 MyWebUniversity.com ™