Files
oldlinux-files/study/Ref-docs/POSIX/susv3/basedefs/sched.h.html
2024-02-19 00:25:23 -05:00

171 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>&lt;sched.h&gt;</title>
</head>
<body bgcolor="white">
<script type="text/javascript" language="JavaScript" src="../jscript/codes.js">
</script>
<basefont size="3"> <a name="&lt;sched.h&gt;"></a> <a name="tag_13_39"></a><!-- &lt;sched.h&gt; -->
<!--header start-->
<center><font size="2">The Open Group Base Specifications Issue 6<br>
IEEE Std 1003.1-2001<br>
Copyright &copy; 2001 The IEEE and The Open Group, All Rights reserved.</font></center>
<!--header end-->
<hr size="2" noshade>
<h4><a name="tag_13_39_01"></a>NAME</h4>
<blockquote>sched.h - execution scheduling (<b>REALTIME</b>)</blockquote>
<h4><a name="tag_13_39_02"></a>SYNOPSIS</h4>
<blockquote class="synopsis">
<div class="box"><tt><sup>[<a href="javascript:open_code('PS')">PS</a>]</sup> <img src="../images/opt-start.gif" alt=
"[Option Start]" border="0"> #include &lt;sched.h&gt; <img src="../images/opt-end.gif" alt="[Option End]" border="0"></tt></div>
</blockquote>
<h4><a name="tag_13_39_03"></a>DESCRIPTION</h4>
<blockquote>
<p>The <i>&lt;sched.h&gt;</i> header shall define the <b>sched_param</b> structure, which contains the scheduling parameters
required for implementation of each supported scheduling policy. This structure shall contain at least the following member:</p>
<pre>
<tt>int sched_priority </tt> Process execution scheduling priority. <tt>
</tt>
</pre>
<p><sup>[<a href="javascript:open_code('SS')">SS|TSP</a>]</sup> <img src="../images/opt-start.gif" alt="[Option Start]" border="0">
In addition, if _POSIX_SPORADIC_SERVER or _POSIX_THREAD_SPORADIC_SERVER is defined, the <b>sched_param</b> structure defined in
<i>&lt;sched.h&gt;</i> shall contain the following members in addition to those specified above:</p>
<pre>
<tt>int sched_ss_low_priority</tt> Low scheduling priority for <tt>
</tt> sporadic server. <tt>
struct timespec sched_ss_repl_period </tt> Replenishment period for <tt>
</tt> sporadic server. <tt>
struct timespec sched_ss_init_budget </tt> Initial budget for sporadic server. <tt>
int sched_ss_max_repl </tt> Maximum pending replenishments for <tt>
</tt> sporadic server. <tt>
</tt>
</pre>
<img src="../images/opt-end.gif" alt="[Option End]" border="0">
<p>Each process is controlled by an associated scheduling policy and priority. Associated with each policy is a priority range.
Each policy definition specifies the minimum priority range for that policy. The priority ranges for each policy may overlap the
priority ranges of other policies.</p>
<p>Four scheduling policies are defined; others may be defined by the implementation. The four standard policies are indicated by
the values of the following symbolic constants:</p>
<dl compact>
<dt>SCHED_FIFO</dt>
<dd>First in-first out (FIFO) scheduling policy.</dd>
<dt>SCHED_RR</dt>
<dd>Round robin scheduling policy.</dd>
<dt>SCHED_SPORADIC</dt>
<dd><sup>[<a href="javascript:open_code('SS')">SS|TSP</a>]</sup> <img src="../images/opt-start.gif" alt="[Option Start]" border=
"0"> Sporadic server scheduling policy. <img src="../images/opt-end.gif" alt="[Option End]" border="0"></dd>
<dt>SCHED_OTHER</dt>
<dd>Another scheduling policy.</dd>
</dl>
<p>The values of these constants are distinct.</p>
<p>The following shall be declared as functions and may also be defined as macros. Function prototypes shall be provided.</p>
<pre>
<tt>int sched_get_priority_max(int);
int sched_get_priority_min(int);
int sched_getparam(pid_t, struct sched_param *);
int sched_getscheduler(pid_t);
int sched_rr_get_interval(pid_t, struct timespec *);
int sched_setparam(pid_t, const struct sched_param *);
int sched_setscheduler(pid_t, int, const struct sched_param *);
int sched_yield(void);
</tt>
</pre>
<p>Inclusion of the <i>&lt;sched.h&gt;</i> header may make visible all symbols from the <a href=
"time.h.html"><i>&lt;time.h&gt;</i></a> header.</p>
</blockquote>
<hr>
<div class="box"><em>The following sections are informative.</em></div>
<h4><a name="tag_13_39_04"></a>APPLICATION USAGE</h4>
<blockquote>
<p>None.</p>
</blockquote>
<h4><a name="tag_13_39_05"></a>RATIONALE</h4>
<blockquote>
<p>None.</p>
</blockquote>
<h4><a name="tag_13_39_06"></a>FUTURE DIRECTIONS</h4>
<blockquote>
<p>None.</p>
</blockquote>
<h4><a name="tag_13_39_07"></a>SEE ALSO</h4>
<blockquote>
<p><a href="time.h.html"><i>&lt;time.h&gt;</i></a></p>
</blockquote>
<h4><a name="tag_13_39_08"></a>CHANGE HISTORY</h4>
<blockquote>
<p>First released in Issue 5. Included for alignment with the POSIX Realtime Extension.</p>
</blockquote>
<h4><a name="tag_13_39_09"></a>Issue 6</h4>
<blockquote>
<p>The <i>&lt;sched.h&gt;</i> header is marked as part of the Process Scheduling option.</p>
<p>Sporadic server members are added to the <b>sched_param</b> structure, and the SCHED_SPORADIC scheduling policy is added for
alignment with IEEE&nbsp;Std&nbsp;1003.1d-1999.</p>
<p>IEEE PASC Interpretation 1003.1 #108 is applied, correcting the <b>sched_param</b> structure whose members
<i>sched_ss_repl_period</i> and <i>sched_ss_init_budget</i> should be type <b>struct timespec</b> and not <b>timespec</b>.</p>
<p>Symbols from <a href="../basedefs/time.h.html"><i>&lt;time.h&gt;</i></a> may be made visible when <i>&lt;sched.h&gt;</i> is
included.</p>
</blockquote>
<div class="box"><em>End of informative text.</em></div>
<hr>
<hr size="2" noshade>
<center><font size="2"><!--footer start-->
UNIX &reg; is a registered Trademark of The Open Group.<br>
POSIX &reg; 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>