OSDN Git Service

fd4c657f18adf0eea9f55b3d7d01143e2615d78d
[linuxjm/jm.git] / manual / LDP_man-pages / draft / man3 / pthread_attr_setscope.3
1 .\" Copyright (c) 2008 Linux Foundation, written by Michael Kerrisk
2 .\"     <mtk.manpages@gmail.com>
3 .\"
4 .\" %%%LICENSE_START(VERBATIM)
5 .\" Permission is granted to make and distribute verbatim copies of this
6 .\" manual provided the copyright notice and this permission notice are
7 .\" preserved on all copies.
8 .\"
9 .\" Permission is granted to copy and distribute modified versions of this
10 .\" manual under the conditions for verbatim copying, provided that the
11 .\" entire resulting derived work is distributed under the terms of a
12 .\" permission notice identical to this one.
13 .\"
14 .\" Since the Linux kernel and libraries are constantly changing, this
15 .\" manual page may be incorrect or out-of-date.  The author(s) assume no
16 .\" responsibility for errors or omissions, or for damages resulting from
17 .\" the use of the information contained herein.  The author(s) may not
18 .\" have taken the same level of care in the production of this manual,
19 .\" which is licensed free of charge, as they might when working
20 .\" professionally.
21 .\"
22 .\" Formatted or processed versions of this manual, if unaccompanied by
23 .\" the source, must acknowledge the copyright and authors of this work.
24 .\" %%%LICENSE_END
25 .\"
26 .\"*******************************************************************
27 .\"
28 .\" This file was generated with po4a. Translate the source file.
29 .\"
30 .\"*******************************************************************
31 .\"
32 .\" Japanese Version Copyright (c) 2012  Akihiro MOTOKI
33 .\"         all rights reserved.
34 .\" Translated 2012-05-04, Akihiro MOTOKI <amotoki@gmail.com>
35 .\" Updated 2013-07-17, Akihiro MOTOKI <amotoki@gmail.com>
36 .\" Updated 2013-07-31, Akihiro MOTOKI <amotoki@gmail.com>
37 .\"
38 .TH PTHREAD_ATTR_SETSCOPE 3 2017\-09\-15 Linux "Linux Programmer's Manual"
39 .SH 名前
40 pthread_attr_setscope, pthread_attr_getscope \-
41 スレッド属性オブジェクトの contention scope 属性の設定/取得を行う
42 .SH 書式
43 .nf
44 \fB#include <pthread.h>\fP
45 .PP
46 \fBint pthread_attr_setscope(pthread_attr_t *\fP\fIattr\fP\fB, int \fP\fIscope\fP\fB);\fP
47 \fBint pthread_attr_getscope(const pthread_attr_t *\fP\fIattr\fP\fB, int *\fP\fIscope\fP\fB);\fP
48 .PP
49 \fI\-pthread\fP でコンパイルしてリンクする。
50 .fi
51 .SH 説明
52 The \fBpthread_attr_setscope\fP()  function sets the contention scope attribute
53 of the thread attributes object referred to by \fIattr\fP to the value
54 specified in \fIscope\fP.  The contention scope attribute defines the set of
55 threads against which a thread competes for resources such as the CPU.
56 POSIX.1 specifies two possible values for \fIscope\fP:
57 .TP 
58 \fBPTHREAD_SCOPE_SYSTEM\fP
59 スレッドは、同じスケジューリング割り当てドメイン (一つ以上のプロセッサ
60 のグループ) にある、システム上の全てのプロセスの自分以外の全ての
61 スレッドとリソースを取り合う。
62 \fBPTHREAD_SCOPE_SYSTEM\fP のスレッドは、スケジューリングポリシーと
63 優先度に基づき、互いに相対的にスケジューリングされる。
64 .TP 
65 \fBPTHREAD_SCOPE_PROCESS\fP
66 The thread competes for resources with all other threads in the same process
67 that were also created with the \fBPTHREAD_SCOPE_PROCESS\fP contention scope.
68 \fBPTHREAD_SCOPE_PROCESS\fP threads are scheduled relative to other threads in
69 the process according to their scheduling policy and priority.  POSIX.1
70 leaves it unspecified how these threads contend with other threads in other
71 process on the system or with other threads in the same process that were
72 created with the \fBPTHREAD_SCOPE_SYSTEM\fP contention scope.
73 .PP
74 POSIX.1 requires that an implementation support at least one of these
75 contention scopes.  Linux supports \fBPTHREAD_SCOPE_SYSTEM\fP, but not
76 \fBPTHREAD_SCOPE_PROCESS\fP.
77 .PP
78 複数の contention scope をサポートしているシステムで、 \fBpthread_create\fP(3) を呼び出した際に
79 \fBpthread_attr_setscope\fP() で行ったパラメーター設定を有効にするには、 呼び出し側で
80 \fBpthread_attr_setinheritsched\fP(3) を使って 属性オブジェクト \fIattr\fP の inherit\-scheduler
81 属性を \fBPTHREAD_EXPLICIT_SCHED\fP に設定しておかなければならない。
82 .PP
83 \fBpthread_attr_getscope\fP() は、
84 スレッド属性オブジェクト \fIattr\fP の contention scope 属性を
85 \fIscope\fP が指すバッファーに入れて返す。
86 .SH 返り値
87 成功すると、これらの関数は 0 を返す。
88 エラーの場合、0 以外のエラー番号を返す。
89 .SH エラー
90 \fBpthread_attr_setscope\fP() は以下のエラーで失敗する場合がある。
91 .TP 
92 \fBEINVAL\fP
93 \fIscope\fP に無効な値が指定された。
94 .TP 
95 \fBENOTSUP\fP
96 \fIscope\fP に値 \fBPTHREAD_SCOPE_PROCESS\fP が指定された。
97 この値は Linux でサポートされていない。
98 .SH 属性
99 この節で使用されている用語の説明については、 \fBattributes\fP(7) を参照。
100 .TS
101 allbox;
102 lbw24 lb lb
103 l l l.
104 インターフェース        属性  値
105 T{
106 \fBpthread_attr_setscope\fP(),
107 \fBpthread_attr_getscope\fP()
108 T}      Thread safety   MT\-Safe
109 .TE
110 .SH 準拠
111 POSIX.1\-2001, POSIX.1\-2008.
112 .SH 注意
113 \fBPTHREAD_SCOPE_SYSTEM\fP contention scope では、通常は、一つの
114 ユーザー空間スレッドは一つのカーネルスケジューリングエンティティに
115 直接結び付けられる。
116 Linux では、廃止予定の LinuxThreads 実装も新しい NPTL 実装もこれに
117 該当し、両方とも 1:1 で結び付けられるスレッド実装となっている。
118 .PP
119 POSIX.1 specifies that the default contention scope is
120 implementation\-defined.
121 .SH 関連項目
122 .ad l
123 .nh
124 \fBpthread_attr_init\fP(3), \fBpthread_attr_setaffinity_np\fP(3),
125 \fBpthread_attr_setinheritsched\fP(3), \fBpthread_attr_setschedparam\fP(3),
126 \fBpthread_attr_setschedpolicy\fP(3), \fBpthread_create\fP(3), \fBpthreads\fP(7)
127 .SH この文書について
128 この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 5.10 の一部である。プロジェクトの説明とバグ報告に関する情報は
129 \%https://www.kernel.org/doc/man\-pages/ に書かれている。