.\" Copyright (c) 2008 Linux Foundation, written by Michael Kerrisk .\" .\" .\" %%%LICENSE_START(VERBATIM) .\" Permission is granted to make and distribute verbatim copies of this .\" manual provided the copyright notice and this permission notice are .\" preserved on all copies. .\" .\" Permission is granted to copy and distribute modified versions of this .\" manual under the conditions for verbatim copying, provided that the .\" entire resulting derived work is distributed under the terms of a .\" permission notice identical to this one. .\" .\" Since the Linux kernel and libraries are constantly changing, this .\" manual page may be incorrect or out-of-date. The author(s) assume no .\" responsibility for errors or omissions, or for damages resulting from .\" the use of the information contained herein. The author(s) may not .\" have taken the same level of care in the production of this manual, .\" which is licensed free of charge, as they might when working .\" professionally. .\" .\" Formatted or processed versions of this manual, if unaccompanied by .\" the source, must acknowledge the copyright and authors of this work. .\" %%%LICENSE_END .\" .\"******************************************************************* .\" .\" This file was generated with po4a. Translate the source file. .\" .\"******************************************************************* .\" .\" Japanese Version Copyright (c) 2012 Akihiro MOTOKI .\" all rights reserved. .\" Translated 2012-05-03, Akihiro MOTOKI .\" Updated 2013-07-17, Akihiro MOTOKI .\" Updated 2013-07-31, Akihiro MOTOKI .\" .TH PTHREAD_ATTR_SETSCHEDPARAM 3 2014\-05\-21 Linux "Linux Programmer's Manual" .SH 名前 pthread_attr_setschedparam, pthread_attr_getschedparam \- スレッド属性オブジェクトのスケジューリングパラメーター属性の設定/取得を行う .SH 書式 .nf \fB#include \fP \fBint pthread_attr_setschedparam(pthread_attr_t *\fP\fIattr\fP\fB,\fP \fB const struct sched_param *\fP\fIparam\fP\fB);\fP \fBint pthread_attr_getschedparam(const pthread_attr_t *\fP\fIattr\fP\fB,\fP \fB struct sched_param *\fP\fIparam\fP\fB);\fP .sp \fI\-pthread\fP でコンパイルしてリンクする。 .fi .SH 説明 \fBpthread_attr_setschedparam\fP() 関数は、 \fIattr\fP が参照するスレッド属性オブジェクトのスケジューリング パラメーター属性を \fIparam\fP が指すバッファーで指定された値に設定する。 これらの属性により、スレッド属性オブジェクト \fIattr\fP を使って 作成されるスレッドのスケジューリングパラメーターが決定される。 \fBpthread_attr_getschedparam\fP() は、 スレッド属性オブジェクト \fIattr\fP のスケジューリングパラメーター属性を \fIparam\fP が指すバッファーに入れて返す。 スケジューリングパラメーターは以下の構造体で管理される。 .in +4n .nf struct sched_param { int sched_priority; /* Scheduling priority */ }; .fi .in 見て分かる通り、サポートされているスケジューリングパラメーターは一つだけである。各スケジューリングポリシーで許可されるスケジューリング優先度の詳細については、\fBsched\fP(7) を参照のこと。 \fBpthread_create\fP(3) を呼び出した際に \fBpthread_attr_setschedparam\fP() で行ったパラメーター設定を有効にするには、 呼び出し側で \fBpthread_attr_setinheritsched\fP(3) を使って 属性オブジェクト \fIattr\fP の inherit\-scheduler 属性を \fBPTHREAD_EXPLICIT_SCHED\fP に設定しておかなければならない。 .SH 返り値 成功すると、これらの関数は 0 を返す。 エラーの場合、0 以外のエラー番号を返す。 .SH エラー .\" .SH VERSIONS .\" Available since glibc 2.0. POSIX.1 では、 \fBpthread_attr_setschedparam\fP() について \fBEINVAL\fP と \fBENOTSUP\fP が規定されている。 Linux では、これらの関数は常に成功する (ただし、移植性や将来も動作することを保証したいアプリケーションでは 正のエラーの返り値を処理するようにすべきである)。 .SH 属性 .SS "マルチスレッディング (pthreads(7) 参照)" 関数 \fBpthread_attr_setschedparam\fP() と \fBpthread_attr_getschedparam\fP() はスレッドセーフである。 .SH 準拠 POSIX.1\-2001. .SH 注意 Linux でサポートされているスレッドのスケジューリングポリシーのリストに ついては、 \fBpthread_attr_setschedpolicy\fP(3) を参照。 .SH 例 \fBpthread_setschedparam\fP(3) を参照。 .SH 関連項目 .ad l .nh \fBsched_get_priority_min\fP(2), \fBpthread_attr_init\fP(3), \fBpthread_attr_setinheritsched\fP(3), \fBpthread_attr_setschedpolicy\fP(3), \fBpthread_create\fP(3), \fBpthread_setschedparam\fP(3), \fBpthread_setschedprio\fP(3), \fBpthreads\fP(7), \fBsched\fP(7) .SH この文書について この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.79 の一部 である。プロジェクトの説明とバグ報告に関する情報は http://www.kernel.org/doc/man\-pages/ に書かれている。