sched_get_priority_maxのヘルプ・マニュアル
日本語 英語
sched_get_priority_max --help
man sched_get_priority_max
SCHED_GET_PRIORITY_MAX(2) Linux Programmer’s Manual SCHED_GET_PRIORITY_MAX(2)
名前
sched_get_priority_max, sched_get_priority_min - 静的プライオリティの
範囲を取得する
書式
#include
int sched_get_priority_max(int policy);
int sched_get_priority_min(int policy);
説明
sched_get_priority_max() はpolicy によって指定されたスケジューリング の
アルゴリズムで使用されるプライオリティの最大値を返す。 sched_get_prior-
ity_min() はpolicy によって指定されたスケジューリングのアルゴリズムで使
用 さ れ る プ ライオリティの最小値を返す。サポートされる policy の値は
SCHED_FIFO、 SCHED_RR、 SCHED_OTHER、 SCHED_BATCH である。これらのス ケ
ジューリング方針に関する詳細は sched_setscheduler(2) に書かれている。
数 値的に大きなプライオリティ値を持つプロセスは小さなプライオリティ値を
持つプロセスより前にスケジュールされる 。 こ の た め sched_get_prior-
ity_max() が返す値は sched_get_priority_min() が返す値よりも大きい。
Linux では SCHED_FIFO と SCHED_RR では 1 から 99 の範囲の静的プライオリ
ティーを持ち、SCHED_OTHER と SCHED_BATCH ではプライオリティとして 0 を
持 つ。それぞれの方針のスケジューリング・プライオリティの範囲は変更する
ことができない。
スケジューリング・プライオリティの範囲は他の POSIX システムと異なってい
る かもしれない。それで、移植性(portable)のあるアプリケーションでは仮想
的な範囲を用い sched_get_priority_max() と sched_get_priority_min() で
与 え られた間隔にマップして使用することはいい考えである。 POSIX.1-2001
では SCHED_FIFO と SCHED_RR における最大値と最小値の間隔を少なくとも 32
にすることを要求している。
POSIX システムでは sched_get_priority_max() と sched_get_priority_min()
は に _POSIX_PRIORITY_SCHEDULING が定義されている場合にの み
使用可能である。
返り値
成 功した場合は sched_get_priority_max() と sched_get_priority_min() は
指定されたスケジューリング方針のプライオリティの最大値/最小値を返す。エ
ラーの場合は -1 が返され、 errno が適切に設定される。
エラー
EINVAL 引き数 policy が定義されているスケジューリング方針と一致しない。
準拠
POSIX.1-2001.
関連項目
sched_getaffinity(2), sched_getparam(2) sched_getscheduler(2),
sched_setaffinity(2), sched_setparam(2), sched_setscheduler(2),
Programming for the real world - POSIX.4 by Bill O. Gallmeister,
O’Reilly & Associates, Inc., ISBN 1-56592-074-0
Linux 2006-03-23 SCHED_GET_PRIORITY_MAX(2)
SCHED_GET_PRIORITY_MAX(2) Linux Programmer’s Manual SCHED_GET_PRIORITY_MAX(2)
NAME
sched_get_priority_max, sched_get_priority_min - get static priority
range
SYNOPSIS
#include
int sched_get_priority_max(int policy);
int sched_get_priority_min(int policy);
DESCRIPTION
sched_get_priority_max() returns the maximum priority value that can be
used with the scheduling algorithm identified by policy.
sched_get_priority_min() returns the minimum priority value that can be
used with the scheduling algorithm identified by policy. Supported
policy values are SCHED_FIFO, SCHED_RR, SCHED_OTHER, and SCHED_BATCH.
Further details about these policies can be found in sched_setsched-
uler(2).
Processes with numerically higher priority values are scheduled before
processes with numerically lower priority values. Thus, the value
returned by sched_get_priority_max() will be greater than the value
returned by sched_get_priority_min().
Linux allows the static priority value range 1 to 99 for SCHED_FIFO and
SCHED_RR and the priority 0 for SCHED_OTHER and SCHED_BATCH. Schedul-
ing priority ranges for the various policies are not alterable.
The range of scheduling priorities may vary on other POSIX systems,
thus it is a good idea for portable applications to use a virtual pri-
ority range and map it to the interval given by sched_get_prior-
ity_max() and sched_get_priority_min(). POSIX.1-2001 requires a spread
of at least 32 between the maximum and the minimum values for
SCHED_FIFO and SCHED_RR.
POSIX systems on which sched_get_priority_max() and sched_get_prior-
ity_min() are available define _POSIX_PRIORITY_SCHEDULING in
.
RETURN VALUE
On success, sched_get_priority_max() and sched_get_priority_min()
return the maximum/minimum priority value for the named scheduling pol-
icy. On error, -1 is returned, and errno is set appropriately.
ERRORS
EINVAL The argument policy does not identify a defined scheduling pol-
icy.
CONFORMING TO
POSIX.1-2001.
SEE ALSO
sched_getaffinity(2), sched_getparam(2), sched_getscheduler(2),
sched_setaffinity(2), sched_setparam(2), sched_setscheduler(2)
Programming for the real world - POSIX.4 by Bill O. Gallmeister,
O’Reilly & Associates, Inc., ISBN 1-56592-074-0
COLOPHON
This page is part of release 3.22 of the Linux man-pages project. A
description of the project, and information about reporting bugs, can
be found at http://www.kernel.org/doc/man-pages/.
Linux 2006-03-23 SCHED_GET_PRIORITY_MAX(2)