1
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
4
<META HTTP-EQUIV="CONTENT-TYPE" CONTENT="text/html; charset=utf-8">
5
<TITLE>PTHREAD_SETSCHEDPARAM(3) manual page</TITLE>
6
<META NAME="GENERATOR" CONTENT="OpenOffice.org 2.4 (Linux)">
7
<META NAME="CREATED" CONTENT="20050504;18110100">
8
<META NAME="CHANGEDBY" CONTENT="Ross Johnson">
9
<META NAME="CHANGED" CONTENT="20080630;22330400">
10
<!-- manual page source format generated by PolyglotMan v3.2, -->
11
<!-- available at http://polyglotman.sourceforge.net/ -->
13
<BODY LANG="en-GB" BGCOLOR="#ffffff" DIR="LTR">
14
<H4>POSIX Threads for Windows – REFERENCE - <A HREF="http://sources.redhat.com/pthreads-win32">Pthreads-w32</A></H4>
15
<P><A HREF="index.html">Reference Index</A></P>
16
<P><A HREF="#toc">Table of Contents</A></P>
17
<H2><A HREF="#toc0" NAME="sect0">Name</A></H2>
18
<P>pthread_setschedparam, pthread_getschedparam - control thread
23
<H2><A HREF="#toc1" NAME="sect1">Synopsis</A></H2>
24
<P><B>#include <pthread.h></B>
26
<P><B>int pthread_setschedparam(pthread_t </B><I>target_thread</I><B>,
27
int </B><I>policy</I><B>, const struct sched_param *</B><I>param</I><B>);</B>
29
<P><B>int pthread_getschedparam(pthread_t </B><I>target_thread</I><B>,
30
int *</B><I>policy</I><B>, struct sched_param *</B><I>param</I><B>);</B>
32
<H2><A HREF="#toc2" NAME="sect2">Description</A></H2>
33
<P><B>pthread_setschedparam</B> sets the scheduling parameters for
34
the thread <I>target_thread</I> as indicated by <I>policy</I> and
35
<I>param</I>. <I>policy</I> can be either <B>SCHED_OTHER</B>
36
(regular, non-real-time scheduling), <B>SCHED_RR</B> (real-time,
37
round-robin) or <B>SCHED_FIFO</B> (real-time, first-in first-out).
38
<I>param</I> specifies the scheduling priority for the two real-time
40
<P><B>Pthreads-w32</B> only supports SCHED_OTHER and does not support
41
the real-time scheduling policies <B>SCHED_RR</B> and <B>SCHED_FIFO.</B>
43
<P><B>pthread_getschedparam</B> retrieves the scheduling policy and
44
scheduling parameters for the thread <I>target_thread</I> and stores
45
them in the locations pointed to by <I>policy</I> and <I>param</I>,
48
<H2><A HREF="#toc3" NAME="sect3">Return Value</A></H2>
49
<P><B>pthread_setschedparam</B> and <B>pthread_getschedparam</B>
50
return 0 on success and a non-zero error code on error.
52
<H2><A HREF="#toc4" NAME="sect4">Errors</A></H2>
53
<P>On error, <B>pthread_setschedparam</B> returns the following error
58
<DT STYLE="margin-right: 1cm; margin-bottom: 0.5cm"><B>ENOTSUP</B>
59
</DT><DD STYLE="margin-right: 1cm; margin-bottom: 0.5cm">
60
<I>policy</I> is not <B>SCHED_OTHER.</B></DD><DT STYLE="margin-right: 1cm; margin-bottom: 0.5cm">
62
</DT><DD STYLE="margin-right: 1cm; margin-bottom: 0.5cm">
63
One of the arguments is invalid, or the priority value specified by
64
<I>param</I> is not valid for the specified policy.</DD><DT STYLE="margin-right: 1cm; margin-bottom: 0.5cm">
66
</DT><DD STYLE="margin-right: 1cm; margin-bottom: 0.5cm">
67
The <I>target_thread</I> is invalid or has already terminated
71
On error, <B>pthread_getschedparam</B> returns the following error
76
<DT STYLE="margin-right: 1cm; margin-bottom: 0.5cm"><B>ESRCH</B>
77
</DT><DD STYLE="margin-right: 1cm; margin-bottom: 0.5cm">
78
the <I>target_thread</I> is invalid or has already terminated
82
<A HREF="#toc5" NAME="sect5">Author</A></H2>
83
<P>Xavier Leroy <Xavier.Leroy@inria.fr>
85
<P>Modified by Ross Johnson for use with <A HREF="http://sources.redhat.com/pthreads-win32">Pthreads-w32</A>.</P>
86
<H2><A HREF="#toc6" NAME="sect6">See Also</A></H2>
87
<P><A HREF="sched_setscheduler.html"><B>sched_setscheduler</B>(2)</A>
88
, <A HREF="sched_getscheduler.html"><B>sched_getscheduler</B>(2)</A>
89
, <A HREF="sched_getparam.html"><B>sched_getparam</B>(2)</A> ,
90
<A HREF="pthread_attr_init.html"><B>pthread_attr_setschedpolicy</B>(3)</A>
91
, <A HREF="pthread_attr_init.html"><B>pthread_attr_setschedparam</B>(3)</A>
95
<P><A NAME="toc"></A><B>Table of Contents</B></P>
97
<LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect0" NAME="toc0">Name</A>
99
<LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect1" NAME="toc1">Synopsis</A>
101
<LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect2" NAME="toc2">Description</A>
103
<LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect3" NAME="toc3">Return
106
<LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect4" NAME="toc4">Errors</A>
108
<LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect5" NAME="toc5">Author</A>
110
<LI><P><A HREF="#sect6" NAME="toc6">See Also</A>
b'\\ No newline at end of file'