.\" all rights reserved.
.\" Translated 2012-05-04, Akihiro MOTOKI <amotoki@gmail.com>
.\"
-.TH PTHREAD_SETSCHEDPARAM 3 2014\-05\-19 Linux "Linux Programmer's Manual"
+.TH PTHREAD_SETSCHEDPARAM 3 2014\-12\-31 Linux "Linux Programmer's Manual"
.SH 名前
pthread_setschedparam, pthread_getschedparam \- スレッドの
-スケジューリングポリシーとパラメータを設定/取得する
+ã\82¹ã\82±ã\82¸ã\83¥ã\83¼ã\83ªã\83³ã\82°ã\83\9dã\83ªã\82·ã\83¼ã\81¨ã\83\91ã\83©ã\83¡ã\83¼ã\82¿ã\83¼ã\82\92è¨å®\9a/å\8f\96å¾\97ã\81\99ã\82\8b
.SH 書式
.nf
\fB#include <pthread.h>\fP
-\fBpthread_setschedparam(pthread_t \fP\fIthread\fP\fB, int \fP\fIpolicy\fP\fB,\fP
-\fB const struct sched_param *\fP\fIparam\fP\fB);\fP
-\fBpthread_getschedparam(pthread_t \fP\fIthread\fP\fB, int *\fP\fIpolicy\fP\fB,\fP
-\fB struct sched_param *\fP\fIparam\fP\fB);\fP
+\fBint pthread_setschedparam(pthread_t \fP\fIthread\fP\fB, int \fP\fIpolicy\fP\fB,\fP
+\fB const struct sched_param *\fP\fIparam\fP\fB);\fP
+\fBint pthread_getschedparam(pthread_t \fP\fIthread\fP\fB, int *\fP\fIpolicy\fP\fB,\fP
+\fB struct sched_param *\fP\fIparam\fP\fB);\fP
.sp
\fI\-pthread\fP でコンパイルしてリンクする。
.fi
.SH 説明
\fBpthread_setschedparam\fP() 関数は、スレッド \fIthread\fP の
-スケジューリングポリシーとスケジューリングパラメータを設定する。
+ã\82¹ã\82±ã\82¸ã\83¥ã\83¼ã\83ªã\83³ã\82°ã\83\9dã\83ªã\82·ã\83¼ã\81¨ã\82¹ã\82±ã\82¸ã\83¥ã\83¼ã\83ªã\83³ã\82°ã\83\91ã\83©ã\83¡ã\83¼ã\82¿ã\83¼ã\82\92è¨å®\9aã\81\99ã\82\8bã\80\82
.\" FIXME . pthread_setschedparam() places no restriction on the policy,
.\" but pthread_attr_setschedpolicy() restricts policy to RR/FIFO/OTHER
\fIpolicy\fP は \fIthread\fP の新しいスケジューリングポリシーを指定する。 \fIpolicy\fP に指定できる値とその意味は
\fBsched\fP(7) で説明されている。
-\fIparam\fP が指す構造体は \fIthread\fP の新しいスケジューリングパラメータを
-指定する。スケジューリングパラメータは以下の構造体で管理される。
+\fIparam\fP ã\81\8cæ\8c\87ã\81\99æ§\8bé\80 ä½\93ã\81¯ \fIthread\fP ã\81®æ\96°ã\81\97ã\81\84ã\82¹ã\82±ã\82¸ã\83¥ã\83¼ã\83ªã\83³ã\82°ã\83\91ã\83©ã\83¡ã\83¼ã\82¿ã\83¼ã\82\92
+æ\8c\87å®\9aã\81\99ã\82\8bã\80\82ã\82¹ã\82±ã\82¸ã\83¥ã\83¼ã\83ªã\83³ã\82°ã\83\91ã\83©ã\83¡ã\83¼ã\82¿ã\83¼ã\81¯ä»¥ä¸\8bã\81®æ§\8bé\80 ä½\93ã\81§ç®¡ç\90\86ã\81\95ã\82\8cã\82\8bã\80\82
.in +4n
.nf
.fi
.in
-見て分かる通り、サポートされているスケジューリングパラメータは一つだけである。各スケジューリングポリシーで許可されるスケジューリング優先度の詳細については、\fBsched\fP(7)
+è¦\8bã\81¦å\88\86ã\81\8bã\82\8bé\80\9aã\82\8aã\80\81ã\82µã\83\9dã\83¼ã\83\88ã\81\95ã\82\8cã\81¦ã\81\84ã\82\8bã\82¹ã\82±ã\82¸ã\83¥ã\83¼ã\83ªã\83³ã\82°ã\83\91ã\83©ã\83¡ã\83¼ã\82¿ã\83¼ã\81¯ä¸\80ã\81¤ã\81 ã\81\91ã\81§ã\81\82ã\82\8bã\80\82å\90\84ã\82¹ã\82±ã\82¸ã\83¥ã\83¼ã\83ªã\83³ã\82°ã\83\9dã\83ªã\82·ã\83¼ã\81§è¨±å\8f¯ã\81\95ã\82\8cã\82\8bã\82¹ã\82±ã\82¸ã\83¥ã\83¼ã\83ªã\83³ã\82°å\84ªå\85\88度ã\81®è©³ç´°ã\81«ã\81¤ã\81\84ã\81¦ã\81¯ã\80\81\fBsched\fP(7)
を参照のこと。
.\" FIXME . nptl/pthread_setschedparam.c has the following
.\" Eventually (perhaps after writing the mutexattr pages), we
.\" may want to add something on the topic to this page.
\fBpthread_getschedparam\fP() 関数は、スレッド \fIthread\fP の
-スケジューリングポリシーとパラメータを、
-それぞれ \fIpolicy\fP と \fIparam\fP が指すバッファに入れて返す。
+ã\82¹ã\82±ã\82¸ã\83¥ã\83¼ã\83ªã\83³ã\82°ã\83\9dã\83ªã\82·ã\83¼ã\81¨ã\83\91ã\83©ã\83¡ã\83¼ã\82¿ã\83¼ã\82\92ã\80\81
+ã\81\9dã\82\8cã\81\9eã\82\8c \fIpolicy\fP ã\81¨ \fIparam\fP ã\81\8cæ\8c\87ã\81\99ã\83\90ã\83\83ã\83\95ã\82¡ã\83¼ã\81«å\85¥ã\82\8cã\81¦è¿\94ã\81\99ã\80\82
返された優先度の値は、最も最近実行した \fIthread\fP に影響を与える
\fBpthread_setschedparam\fP(), \fBpthread_setschedprio\fP,
\fBpthread_create\fP で設定された値となる。
成功すると、これらの関数は 0 を返す。
エラーの場合、0 以外のエラー番号を返す。
\fBpthread_setschedparam\fP() が失敗した場合、 \fIthread\fP の
-スケジューリングポリシーとパラメータは変更されない。
+ã\82¹ã\82±ã\82¸ã\83¥ã\83¼ã\83ªã\83³ã\82°ã\83\9dã\83ªã\82·ã\83¼ã\81¨ã\83\91ã\83©ã\83¡ã\83¼ã\82¿ã\83¼ã\81¯å¤\89æ\9b´ã\81\95ã\82\8cã\81ªã\81\84ã\80\82
.SH エラー
これらの関数はどちらも以下のエラーで失敗する場合がある。
.TP
\fIparam\fP が \fIpolicy\fP では意味を持たない値である。
.TP
\fBEPERM\fP
-呼び出し側が、指定されたスケジューリングポリシーやパラメータを設定する
+å\91¼ã\81³å\87ºã\81\97å\81´ã\81\8cã\80\81æ\8c\87å®\9aã\81\95ã\82\8cã\81\9fã\82¹ã\82±ã\82¸ã\83¥ã\83¼ã\83ªã\83³ã\82°ã\83\9dã\83ªã\82·ã\83¼ã\82\84ã\83\91ã\83©ã\83¡ã\83¼ã\82¿ã\83¼ã\82\92è¨å®\9aã\81\99ã\82\8b
のに必要な特権を持たない。
.PP
.\" .SH VERSIONS
.\" Available since glibc 2.0
POSIX.1\-2001 では、 \fBpthread_setschedparam\fP() に関して
エラー \fBENOTSUP\fP ("サポートされていない値をスケジューリングポリシーや
-パラメータに設定しようとした") も追加で規定されている。
+ã\83\91ã\83©ã\83¡ã\83¼ã\82¿ã\83¼ã\81«è¨å®\9aã\81\97ã\82\88ã\81\86ã\81¨ã\81\97ã\81\9f") ã\82\82追å\8a ã\81§è¦\8få®\9aã\81\95ã\82\8cã\81¦ã\81\84ã\82\8bã\80\82
.SH 属性
.SS "マルチスレッディング (pthreads(7) 参照)"
関数 \fBpthread_setschedparam\fP() と \fBpthread_getschedparam\fP() はスレッドセーフである。
fpe(" r SCHED_RR\en");
fpe(" o SCHED_OTHER\en");
fpe("\-A Use default thread attributes object\en");
- fpe("\-i {e|s} Set inherit scheduler attribute to\en");
+ fpe("\-i {e|i} Set inherit scheduler attribute to\en");
fpe(" \(aqexplicit\(aq or \(aqinherit\(aq\en");
fpe("\-m<policy><prio> Set scheduling policy and priority on\en");
fpe(" main thread before pthread_create() call\en");
if (main_sched_str != NULL) {
if (!get_policy(main_sched_str[0], &policy))
- usage(argv[0], "Bad policy for main thread (\-s)\en");
+ usage(argv[0], "Bad policy for main thread (\-m)\en");
param.sched_priority = strtol(&main_sched_str[1], NULL, 0);
s = pthread_setschedparam(pthread_self(), policy, ¶m);
/* Destroy unneeded thread attributes object */
- s = pthread_attr_destroy(&attr);
- if (s != 0)
- handle_error_en(s, "pthread_attr_destroy");
+ if (!use_null_attrib) {
+ s = pthread_attr_destroy(&attr);
+ if (s != 0)
+ handle_error_en(s, "pthread_attr_destroy");
+ }
s = pthread_join(thread, NULL);
if (s != 0)
\fBpthread_attr_setschedpolicy\fP(3), \fBpthread_create\fP(3), \fBpthread_self\fP(3),
\fBpthread_setschedprio\fP(3), \fBpthreads\fP(7), \fBsched\fP(7)
.SH この文書について
-この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.67 の一部
+この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.79 の一部
である。プロジェクトの説明とバグ報告に関する情報は
http://www.kernel.org/doc/man\-pages/ に書かれている。