PTHREAD_ATTR_SETSCHEDPARAM


HOME

PTHREAD_ATTR_SETSCHEDPARAM

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

NAME

pthread_attr_setschedparam, pthread_attr_getschedparam − set/get scheduling parameter attributes in thread attributes object

SYNOPSIS

#include <pthread.h>

int pthread_attr_setschedparam(pthread_attr_t *attr,
const struct sched_param *
param);
int pthread_attr_getschedparam(const pthread_attr_t *
attr,
struct sched_param *
param);

Compile and link with −pthread.

DESCRIPTION

The pthread_attr_setschedparam() 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 pthread_attr_getschedparam() 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 sched_param {
int sched_priority; /* 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 sched(7).

In order for the parameter setting made by pthread_attr_setschedparam() 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

POSIX.1 documents EINVAL and ENOTSUP errors for pthread_attr_setschedparam(). On Linux these functions always succeed (but portable and future-proof applications should nevertheless handle a possible error return).

ATTRIBUTES

Multithreading (see pthreads(7))
The pthread_attr_setschedparam() and pthread_attr_getschedparam() functions are thread-safe.

CONFORMING TO

POSIX.1-2001.

NOTES

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

EXAMPLE

See pthread_setschedparam(3).

SEE ALSO

sched_get_priority_min(2), pthread_attr_init(3), pthread_attr_setinheritsched(3), pthread_attr_setschedpolicy(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/frexp.3.html
frexp(3) - convert floating-point number to fractional and i
The frexp() function is used to split the number x into a normalized fraction and an exponent which is stored in exp. RETURN VALUE The frexp() function returns

manpages/randpkt.1.html
randpkt(1) - Random Packet Generator - Linux manual page....
randpkt is a small utility that creates a pcap trace file full of random packets. By creating many randomized packets of a certain type, you can test packet sni

manpages/remove_members.8.html
remove_members(8) - Remove members from a list. (Man Page)
remove_members [options] listname [addr1 ...] OPTIONS f file, file=file Remove member addresses found in the given file. If file is -, read stdin. a, ....(Man)

manpages/latin10.7.html
latin10(7) - ISO 8859-16 character set encoded in octal, dec
The ISO 8859 standard includes several 8-bit extensions to the ASCII character set (also known as ISO 646-IRV). ISO 8859-16, the Latin Alphabet No. 10 is used t

manpages/atanhl.3.html
atanhl(3) - inverse hyperbolic tangent function (Man Page)
The atanh() function calculates the inverse hyperbolic tangent of x; that is the value whose hyperbolic tangent is x. RETURN VALUE On success, these functions r

manpages/glGetPixelMapfv.3gl.html
glGetPixelMapfv(3gl) - return the specified pixel map.......
See the glPixelMap reference page for a description of the acceptable values for the map parameter. glGetPixelMap returns in values the contents of the pixel ma

manpages/optionSaveFile.3.html
optionSaveFile(3) saves the option state to a file..........
This routine will save the state of option processing to a file. The name of that file can be specified with the argument to the --save-opts option, or by appen

manpages/glutInitDisplayMode.3.html
glutInitDisplayMode(3) - sets the initial display mode......
The initial display mode is used when creating top-level windows, subwindows, and overlays to determine the OpenGL display mode for the to-be-created window or

manpages/mattrib.1.html
mattrib(1) - change MSDOS file attribute flags (Man Page)...
Mattrib is used to change MS-DOS file attribute flags. It has the following syntax: mattrib [-a|+a] [-h|+h] [-r|+r] [-s|+s] [-/] [-p] [-X] msdosfile [ msdosfile

manpages/fstatvfs.2.html
fstatvfs(2) - get file system statistics - Linux man page...
The function statvfs() returns information about a mounted filesystem. path is the pathname of any file within the mounted filesystem. buf is a pointer to a sta

manpages/glNormal3bv.3gl.html
glNormal3bv(3gl) - set the current normal vector (Man Page)
The current normal is set to the given coordinates whenever glNormal is issued. Byte, short, or integer arguments are converted to floating-point with a linear

manpages/tc-cbq-details.8.html
tc-cbq-details(8) - Class Based Queueing - Linux man page...
tc-cbq-details.8 - Class Based Queueing is a classful qdisc that implements a rich linksharing hierarchy of classes. It contains shaping elements as well as pri





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