📄 sched.h.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-2003 The Open Group, All Rights Reserved --><title><sched.h></title></head><body bgcolor="white"><script type="text/javascript" language="JavaScript" src="../jscript/codes.js"></script><basefont size="3"> <a name="<sched.h>"></a> <a name="tag_13_39"></a><!-- <sched.h> --> <!--header start--><center><font size="2">The Open Group Base Specifications Issue 6<br>IEEE Std 1003.1, 2003 Edition<br>Copyright © 2001-2003 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 <sched.h> <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><sched.h></i> header shall define the <b>sched_param</b> structure, which contains the scheduling parametersrequired 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><sched.h></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 thepriority ranges of other policies.</p><p>Four scheduling policies are defined; others may be defined by the implementation. The four standard policies are indicated bythe 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><sup>[<a href="javascript:open_code('TPS')">TPS</a>]</sup><img src="../images/opt-start.gif" alt="[Option Start]" border="0">int sched_get_priority_max(int);int sched_get_priority_min(int);<img src="../images/opt-end.gif" alt="[Option End]" border="0">int sched_getparam(pid_t, struct sched_param *);int sched_getscheduler(pid_t);<sup>[<a href="javascript:open_code('TPS')">TPS</a>]</sup><img src="../images/opt-start.gif" alt="[Option Start]" border="0">int sched_rr_get_interval(pid_t, struct timespec *);<img src="../images/opt-end.gif" alt="[Option End]" border="0">int sched_setparam(pid_t, const struct sched_param *);int sched_setscheduler(pid_t, int, const struct sched_param *);<sup>[<a href="javascript:open_code('THR')">THR</a>]</sup><img src="../images/opt-start.gif" alt="[Option Start]" border="0">int sched_yield(void);<img src="../images/opt-end.gif" alt="[Option End]" border="0"><img src="../images/opt-end.gif" alt="[Option End]" border="0"></tt></pre><p>Inclusion of the <i><sched.h></i> header may make visible all symbols from the <a href="time.h.html"><i><time.h></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><time.h></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><sched.h></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 foralignment with IEEE Std 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><time.h></i></a> may be made visible when <i><sched.h></i> isincluded.</p><p>IEEE Std 1003.1-2001/Cor 1-2002, items XSH/TC1/D6/52 and XSH/TC1/D6/53 are applied, aligning the function prototypeshading and margin codes with the System Interfaces volume of IEEE Std 1003.1-2001.</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>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -