157 lines
6.2 KiB
HTML
157 lines
6.2 KiB
HTML
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
|
<html>
|
|
<head>
|
|
<meta name="generator" content="HTML Tidy, see www.w3.org">
|
|
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
|
<link type="text/css" rel="stylesheet" href="style.css"><!-- Generated by The Open Group's rhtm tool v1.2.1 -->
|
|
<!-- Copyright (c) 2001 The Open Group, All Rights Reserved -->
|
|
<title>pthread_attr_getschedparam</title>
|
|
</head>
|
|
<body bgcolor="white">
|
|
<script type="text/javascript" language="JavaScript" src="../jscript/codes.js">
|
|
</script>
|
|
|
|
<basefont size="3"> <a name="pthread_attr_getschedparam"></a> <a name="tag_03_491"></a><!-- pthread_attr_getschedparam -->
|
|
<!--header start-->
|
|
<center><font size="2">The Open Group Base Specifications Issue 6<br>
|
|
IEEE Std 1003.1-2001<br>
|
|
Copyright © 2001 The IEEE and The Open Group, All Rights reserved.</font></center>
|
|
|
|
<!--header end-->
|
|
<hr size="2" noshade>
|
|
<h4><a name="tag_03_491_01"></a>NAME</h4>
|
|
|
|
<blockquote>pthread_attr_getschedparam, pthread_attr_setschedparam - get and set the schedparam attribute</blockquote>
|
|
|
|
<h4><a name="tag_03_491_02"></a>SYNOPSIS</h4>
|
|
|
|
<blockquote class="synopsis">
|
|
<div class="box"><code><tt><sup>[<a href="javascript:open_code('THR')">THR</a>]</sup> <img src="../images/opt-start.gif" alt=
|
|
"[Option Start]" border="0"> #include <<a href="../basedefs/pthread.h.html">pthread.h</a>><br>
|
|
<br>
|
|
int pthread_attr_getschedparam(const pthread_attr_t *restrict</tt> <i>attr</i><tt>,<br>
|
|
struct sched_param *restrict</tt> <i>param</i><tt>);<br>
|
|
int pthread_attr_setschedparam(pthread_attr_t *restrict</tt> <i>attr</i><tt>,<br>
|
|
const struct sched_param *restrict</tt> <i>param</i><tt>); <img src="../images/opt-end.gif"
|
|
alt="[Option End]" border="0"></tt></code></div>
|
|
|
|
<tt><br>
|
|
</tt></blockquote>
|
|
|
|
<h4><a name="tag_03_491_03"></a>DESCRIPTION</h4>
|
|
|
|
<blockquote>
|
|
<p>The <i>pthread_attr_getschedparam</i>(), and <i>pthread_attr_setschedparam</i>() functions, respectively, shall get and set the
|
|
scheduling parameter attributes in the <i>attr</i> argument. The contents of the <i>param</i> structure are defined in the <a href=
|
|
"../basedefs/sched.h.html"><i><sched.h></i></a> header. For the SCHED_FIFO and SCHED_RR policies, the only required member of
|
|
<i>param</i> is <i>sched_priority</i>.</p>
|
|
|
|
<p><sup>[<a href="javascript:open_code('TSP')">TSP</a>]</sup> <img src="../images/opt-start.gif" alt="[Option Start]" border="0">
|
|
For the SCHED_SPORADIC policy, the required members of the <i>param</i> structure are <i>sched_priority</i>,
|
|
<i>sched_ss_low_priority</i>, <i>sched_ss_repl_period</i>, <i>sched_ss_init_budget</i>, and <i>sched_ss_max_repl</i>. The specified
|
|
<i>sched_ss_repl_period</i> must be greater than or equal to the specified <i>sched_ss_init_budget</i> for the function to succeed;
|
|
if it is not, then the function shall fail. The value of <i>sched_ss_max_repl</i> shall be within the inclusive range [1,
|
|
{SS_REPL_MAX}] for the function to succeed; if not, the function shall fail. <img src="../images/opt-end.gif" alt="[Option End]"
|
|
border="0"></p>
|
|
</blockquote>
|
|
|
|
<h4><a name="tag_03_491_04"></a>RETURN VALUE</h4>
|
|
|
|
<blockquote>
|
|
<p>If successful, the <i>pthread_attr_getschedparam</i>() and <i>pthread_attr_setschedparam</i>() functions shall return zero;
|
|
otherwise, an error number shall be returned to indicate the error.</p>
|
|
</blockquote>
|
|
|
|
<h4><a name="tag_03_491_05"></a>ERRORS</h4>
|
|
|
|
<blockquote>
|
|
<p>The <i>pthread_attr_setschedparam</i>() function may fail if:</p>
|
|
|
|
<dl compact>
|
|
<dt>[EINVAL]</dt>
|
|
|
|
<dd>The value of <i>param</i> is not valid.</dd>
|
|
|
|
<dt>[ENOTSUP]</dt>
|
|
|
|
<dd>An attempt was made to set the attribute to an unsupported value.</dd>
|
|
</dl>
|
|
|
|
<p>These functions shall not return an error code of [EINTR].</p>
|
|
</blockquote>
|
|
|
|
<hr>
|
|
<div class="box"><em>The following sections are informative.</em></div>
|
|
|
|
<h4><a name="tag_03_491_06"></a>EXAMPLES</h4>
|
|
|
|
<blockquote>
|
|
<p>None.</p>
|
|
</blockquote>
|
|
|
|
<h4><a name="tag_03_491_07"></a>APPLICATION USAGE</h4>
|
|
|
|
<blockquote>
|
|
<p>After these attributes have been set, a thread can be created with the specified attributes using <a href=
|
|
"../functions/pthread_create.html"><i>pthread_create</i>()</a>. Using these routines does not affect the current running
|
|
thread.</p>
|
|
</blockquote>
|
|
|
|
<h4><a name="tag_03_491_08"></a>RATIONALE</h4>
|
|
|
|
<blockquote>
|
|
<p>None.</p>
|
|
</blockquote>
|
|
|
|
<h4><a name="tag_03_491_09"></a>FUTURE DIRECTIONS</h4>
|
|
|
|
<blockquote>
|
|
<p>None.</p>
|
|
</blockquote>
|
|
|
|
<h4><a name="tag_03_491_10"></a>SEE ALSO</h4>
|
|
|
|
<blockquote>
|
|
<p><a href="pthread_attr_destroy.html"><i>pthread_attr_destroy</i>()</a> , <a href=
|
|
"pthread_attr_getscope.html"><i>pthread_attr_getscope</i>()</a> , <a href=
|
|
"pthread_attr_getinheritsched.html"><i>pthread_attr_getinheritsched</i>()</a> , <a href=
|
|
"pthread_attr_getschedpolicy.html"><i>pthread_attr_getschedpolicy</i>()</a> , <a href=
|
|
"pthread_create.html"><i>pthread_create</i>()</a> , the Base Definitions volume of IEEE Std 1003.1-2001, <a href=
|
|
"../basedefs/pthread.h.html"><i><pthread.h></i></a>, <a href="../basedefs/sched.h.html"><i><sched.h></i></a></p>
|
|
</blockquote>
|
|
|
|
<h4><a name="tag_03_491_11"></a>CHANGE HISTORY</h4>
|
|
|
|
<blockquote>
|
|
<p>First released in Issue 5. Included for alignment with the POSIX Threads Extension.</p>
|
|
</blockquote>
|
|
|
|
<h4><a name="tag_03_491_12"></a>Issue 6</h4>
|
|
|
|
<blockquote>
|
|
<p>The <i>pthread_attr_getschedparam</i>() and <i>pthread_attr_setschedparam</i>() functions are marked as part of the Threads
|
|
option.</p>
|
|
|
|
<p>The SCHED_SPORADIC scheduling policy is added for alignment with IEEE Std 1003.1d-1999.</p>
|
|
|
|
<p>The <b>restrict</b> keyword is added to the <i>pthread_attr_getschedparam</i>() and <i>pthread_attr_setschedparam</i>()
|
|
prototypes for alignment with the ISO/IEC 9899:1999 standard.</p>
|
|
</blockquote>
|
|
|
|
<div class="box"><em>End of informative text.</em></div>
|
|
|
|
<hr>
|
|
<hr size="2" noshade>
|
|
<center><font size="2"><!--footer start-->
|
|
UNIX ® is a registered Trademark of The Open Group.<br>
|
|
POSIX ® is a registered Trademark of The IEEE.<br>
|
|
[ <a href="../mindex.html">Main Index</a> | <a href="../basedefs/contents.html">XBD</a> | <a href=
|
|
"../utilities/contents.html">XCU</a> | <a href="../functions/contents.html">XSH</a> | <a href="../xrat/contents.html">XRAT</a>
|
|
]</font></center>
|
|
|
|
<!--footer end-->
|
|
<hr size="2" noshade>
|
|
</body>
|
|
</html>
|
|
|