File: pthread_setschedparam.3

package info (click to toggle)
manpages-ja 0.5.0.0.20140515%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 27,672 kB
  • ctags: 7
  • sloc: perl: 161; makefile: 98
file content (156 lines) | stat: -rw-r--r-- 4,399 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
.\"   Copyright (C) 1996-1999 Free Software Foundation, Inc.
.\"
.\"   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.
.\"
.\"   Permission is granted to copy and distribute translations of this
.\" manual into another language, under the above conditions for modified
.\" versions, except that this permission notice may be stated in a
.\" translation approved by the Foundation.
.\"
.\" Copyright (C) 1996 Xavier Leroy.
.\"
.\" Japanese Version Copyright (C) 2003 Suzuki Takashi
.\"         all rights reserved.
.\" Translated Sun Jan  5 14:05:30 JST 2003
.\"         by Suzuki Takashi.
.\"
.\"WORD:    scheduling parameter    スケジューリングパラメータ
.\"WORD:    scheduling policy   スケジューリングポリシー
.\"WORD:    non-realtime        リアルタイムでない
.\"WORD:    realtime            リアルタイム
.\"WORD:    round-robin         ラウンドロビン方式
.\"WORD:    first-in first-out  先入れ先出し(FIFO)方式
.\"
.\"
.TH PTHREAD_SETSCHEDPARAM 3 LinuxThreads


.SH "名前"
pthread_setschedparam, pthread_getschedparam \- スレッドのスケージューリングパラメータを制御する

.SH "書式"
.B #include <pthread.h>

.BI "int pthread_setschedparam(pthread_t " target_thread ", int " policy ", const struct sched_param *" param ");"

.BI "int pthread_getschedparam(pthread_t " target_thread ", int *" policy ", struct sched_param *" param ");"

.SH "説明"

.B "pthread_setschedparam"
はスレッド
.I "target_thread"
のスケジューリングパラメータを
.I "policy"
.I "param"
で示される値に変更する。
.I "policy"
.B "SCHED_OTHER"
( 通常の、リアルタイムでないスケジューリング ) 、
.B "SCHED_RR"
( ラウンドロビン方式のリアルタイムスケジューリング ) 、
.B "SCHED_FIFO"
( 先入れ先出し (FIFO) 方式のリアルタイムスケジューリング )
のいずれかの値をとる。
.I "param"
は 2 つのリアルタイムポリシーに対する
スケジューリング優先度を表す。
スケジューリングポリシーに関するさらなる情報は
.BR "sched_setpolicy" (2)
を参照のこと。

リアルタイムスケジューリングポリシーである
.B "SCHED_RR"
.B "SCHED_FIFO"
は、スーパーユーザ権限をもったプロセスに限って使用できる。

.B "pthread_getschedparam"
はスレッド
.I "target_thread"
のスケジューリングポリシーと
スケジューリングパラメータを取得し、
それぞれ
.I "policy"
.I "param"
で指し示される領域に格納する。

.SH "返り値"
.B "pthread_setschedparam"
および
.B "pthread_getschedparam"
は成功すると 0 を返し、エラーならば非 0 のエラーコードを返す。

.SH "エラー"
エラーの場合、
.B "pthread_setschedparam"
は次のようなエラーコードを返す:
.RS
.TP
.B "EINVAL"
.I "policy"
.BR "SCHED_OTHER" 、
.BR "SCHED_RR" 、
.B "SCHED_FIFO"
のいずれでもない。

.TP
.B "EINVAL"
指定されたポリシーでは
.I "param"
で指定された優先度パラメータは有効ではない。

.TP
.B "EPERM"
呼び出しプロセスはスーパユーザ権限を持っていない。

.TP
.B "ESRCH"
スレッド
.I "target_thread"
は無効またはすでに終了している。

.TP
.B "EFAULT"
.I "param"
が指し示す領域はプロセスのメモリ空間外の領域である。
.RE

エラーの場合、
.B "pthread_getschedparam"
は次のようなエラーコードを返す:
.RS
.TP
.B "ESRCH"
スレッド
.I "target_thread"
は無効またはすでに終了している。

.TP
.B "EFAULT"
.I "policy"
または
.I "param"
が指し示す領域はプロセスのメモリ空間外の領域である。
.RE

.SH "著者"
Xavier Leroy <Xavier.Leroy@inria.fr>

.SH "関連項目"
.BR "sched_setscheduler" (2),
.BR "sched_getscheduler" (2),
.BR "sched_getparam" (2),
.BR "pthread_attr_setschedpolicy" (3),
.BR "pthread_attr_setschedparam" (3).