PTHREAD_ATTR_SETSCHEDPOLICY


HOME

PTHREAD_ATTR_SETSCHEDPOLICY

NAME
SYNOPSIS
DESCRIPTION
RETURN VALUE
ERRORS
ATTRIBUTES
CONFORMING TO
EXAMPLE
SEE ALSO
COLOPHON

NAME

pthread_attr_setschedpolicy, pthread_attr_getschedpolicy − set/get scheduling policy attribute in thread attributes object

SYNOPSIS

#include <pthread.h>

int pthread_attr_setschedpolicy(pthread_attr_t *attr, int policy);
int pthread_attr_getschedpolicy(const pthread_attr_t *
attr, int *policy);

Compile and link with −pthread.

DESCRIPTION

The pthread_attr_setschedpolicy() function sets the scheduling policy attribute of the thread attributes object referred to by attr to the value specified in policy. This attribute determines the scheduling policy of a thread created using the thread attributes object attr.

The supported values for policy are SCHED_FIFO, SCHED_RR, and SCHED_OTHER, with the semantics described in sched(7).

The pthread_attr_getschedpolicy() returns the scheduling policy attribute of the thread attributes object attr in the buffer pointed to by policy.

In order for the policy setting made by pthread_attr_setschedpolicy() to have effect when calling pthread_create(3), the caller must use pthread_attr_setinheritsched(3) to set the inherit-scheduler attribute of the attributes object attr to PTHREAD_EXPLICIT_SCHED.

RETURN VALUE

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

ERRORS

pthread_attr_setschedpolicy() can fail with the following error:

EINVAL

Invalid value in policy.

POSIX.1-2001 also documents an optional ENOTSUP error ("attempt was made to set the attribute to an unsupported value") for pthread_attr_setschedpolicy().

ATTRIBUTES

Multithreading (see pthreads(7))
The pthread_attr_setschedpolicy() and pthread_attr_getschedpolicy() functions are thread-safe.

CONFORMING TO

POSIX.1-2001.

EXAMPLE

See pthread_setschedparam(3).

SEE ALSO

pthread_attr_init(3), pthread_attr_setinheritsched(3), pthread_attr_setschedparam(3), pthread_create(3), pthread_setschedparam(3), pthread_setschedprio(3), pthreads(7), sched(7)

COLOPHON

This page is part of release 3.69 of the Linux man-pages project. A description of the project, information about reporting bugs, and the latest version of this page, can be found at http://www.kernel.org/doc/man−pages/.




More Linux Commands

manpages/redland-config.1.html
redland-config(1) - script to get information about the inst
redland-config is a tool that is used to determine the compile and linker flags that should be used to compile and link programs that use the Redland RDF librar

manpages/git-daemon.1.html
git-daemon(1) A really simple server for Git repositories...
A really simple TCP Git daemon that normally listens on port DEFAULT_GIT_PORT aka 9418. It waits for a connection asking for a service, and will serve that serv

manpages/tk_getSaveFile.n.html
tk_getSaveFile(n) - pop up a dialog box for the user to sele
The procedures tk_getOpenFile and tk_getSaveFile pop up a dialog box for the user to select a file to open or save. The tk_getOpenFile command is usually associ

manpages/TAP::Parser::Result::Version.3pm.html
TAP::Parser::Result::Version(3pm) - TAP syntax version token
This is a subclass of TAP::Parser::Result. A token of this class will be returned if a version line is encountered. TAP version 13 ok 1 not ok 2 The first versi

manpages/acl_copy_int.3.html
acl_copy_int(3) - copy an ACL from external to internal repr
The acl_copy_int() function copies an exportable, contiguous, persistent form of an ACL, pointed to by buf_p, to the internal representation. This function may

manpages/gnutls_pkcs12_bag_set_crt.3.html
gnutls_pkcs12_bag_set_crt(3) - API function - Linux man page
This function will insert the given certificate into the bag. This is just a wrapper over gnutls_pkcs12_bag_set_data(). RETURNS the index of the added bag on su

manpages/glTexCoord4fv.3gl.html
glTexCoord4fv(3gl) - set the current texture coordinates....
glTexCoord specifies texture coordinates in one, two, three, or four dimensions. glTexCoord1 sets the current texture coordinates to (s, 0, 0, 1); a call to glT

manpages/warnx.3.html
warnx(3) - formatted error messages - Linux manual page.....
The err() and warn() family of functions display a formatted error message on the standard error output. In all cases, the last component of the program name, a

manpages/XDeleteProperty.3.html
XDeleteProperty(3) - obtain and change window properties....
The XGetWindowProperty function returns the actual type of the property; the actual format of the property; the number of 8-bit, 16-bit, or 32-bit items transfe

manpages/setaliasent.3.html
setaliasent(3) - read an alias entry - Linux manual page....
One of the databases available with the Name Service Switch (NSS) is the aliases database, that contains mail aliases. (To find out which databases are supporte

manpages/urandom.4.html
urandom(4) - kernel random number source devices (Man Page)
The character special files /dev/random and /dev/urandom (present since Linux 1.3.30) provide an interface to the kernels random number generator. File /dev/ran

manpages/XwcTextPropertyToTextList.3.html
XwcTextPropertyToTextList(3) - convert text lists and text p
The XmbTextListToTextProperty, XwcTextListToTextProperty and Xutf8TextListToTextProperty functions set the specified XTextProperty value to a set of null-separa





We can't live, work or learn in freedom unless the software we use is free.