OSDN Git Service

(split) DP: release pages (catch up to 3.50).
[linuxjm/LDP_man-pages.git] / release / 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 .TH PTHREAD_ATTR_SETSCOPE 3 2008\-10\-24 Linux "Linux Programmer's Manual"
32 .SH 名前
33 pthread_attr_setscope, pthread_attr_getscope \-
34 スレッド属性オブジェクトの contention scope 属性の設定/取得を行う
35 .SH 書式
36 .nf
37 \fB#include <pthread.h>\fP
38
39 \fBint pthread_attr_setscope(pthread_attr_t *\fP\fIattr\fP\fB, int \fP\fIscope\fP\fB);\fP
40 \fBint pthread_attr_getscope(pthread_attr_t *\fP\fIattr\fP\fB, int *\fP\fIscope\fP\fB);\fP
41 .sp
42 \fI\-pthread\fP でコンパイルしてリンクする。
43 .fi
44 .SH 説明
45 \fBpthread_attr_setscope\fP() 関数は、
46 \fIattr\fP が参照するスレッド属性オブジェクトの contention scope
47 属性を \fIscope\fP で指定された値に設定する。
48 contention scope 属性により、
49 スレッドが CPU などのリソースを取り合うスレッド集合が規定される。
50 POSIX.1\-2001 では \fIscope\fP に指定する値として 2 つの値が規定されている。
51 .TP 
52 \fBPTHREAD_SCOPE_SYSTEM\fP
53 スレッドは、同じスケジューリング割り当てドメイン (一つ以上のプロセッサ
54 のグループ) にある、システム上の全てのプロセスの自分以外の全ての
55 スレッドとリソースを取り合う。
56 \fBPTHREAD_SCOPE_SYSTEM\fP のスレッドは、スケジューリングポリシーと
57 優先度に基づき、互いに相対的にスケジューリングされる。
58 .TP 
59 \fBPTHREAD_SCOPE_PROCESS\fP
60 スレッドは、contention scope が \fBPTHREAD_SCOPE_PROCESS\fP で作成された
61 同じプロセスの自分以外の全てのスレッドとリソースを取り合う。
62 \fBPTHREAD_SCOPE_PROCESS\fP のスレッドは、スケジューリングポリシーと優先度
63 に基づき、同じプロセスの他のスレッドと相対的にスケジューリングされる。
64 POSIX.1\-2001 では、これらのスレッドがシステム上の他のプロセスのスレッド
65 や同じプロセス内の contention scope が \fBPTHREAD_SCOPE_SYSTEM\fP で作成
66 された他のスレッドとどのようにリソースを取り合うかは、
67 規定されないままになっている。
68 .PP
69 POSIX.1\-2001 で求められているのは、スレッド実装がこれらの contention
70 scope のうち 1 つをサポートすることだけであるが、
71 両方をサポートすることも認めている。
72 Linux は \fBPTHREAD_SCOPE_SYSTEM\fP をサポートしているが、
73 \fBPTHREAD_SCOPE_PROCESS\fP はサポートしていない。
74
75 \fBpthread_attr_getscope\fP() は、
76 スレッド属性オブジェクト \fIattr\fP の contention scope 属性を
77 \fIscope\fP が指すバッファに入れて返す。
78 .SH 返り値
79 成功すると、これらの関数は 0 を返す。
80 エラーの場合、0 以外のエラー番号を返す。
81 .SH エラー
82 \fBpthread_attr_setscope\fP() は以下のエラーで失敗する場合がある。
83 .TP 
84 \fBEINVAL\fP
85 \fIscope\fP に無効な値が指定された。
86 .TP 
87 \fBENOTSUP\fP
88 \fIscope\fP に値 \fBPTHREAD_SCOPE_PROCESS\fP が指定された。
89 この値は Linux でサポートされていない。
90 .SH 準拠
91 POSIX.1\-2001.
92 .SH 注意
93 \fBPTHREAD_SCOPE_SYSTEM\fP contention scope では、通常は、一つの
94 ユーザ空間スレッドは一つのカーネルスケジューリング・エンティティに
95 直接結び付けられる。
96 Linux では、廃止予定の LinuxThreads 実装も新しい NPTL 実装もこれに
97 該当し、両方とも 1:1 で結び付けられるスレッド実装となっている。
98
99 POSIX.1\-2001 では、 contention scope 属性のデフォルト値は
100 実装時で定義されるものと規定されている。
101 .SH 関連項目
102 .ad l
103 .nh
104 \fBpthread_attr_init\fP(3), \fBpthread_attr_setaffinity_np\fP(3),
105 \fBpthread_attr_setinheritsched\fP(3), \fBpthread_attr_setschedparam\fP(3),
106 \fBpthread_attr_setschedpolicy\fP(3), \fBpthread_create\fP(3), \fBpthreads\fP(7)
107 .SH この文書について
108 この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.50 の一部
109 である。プロジェクトの説明とバグ報告に関する情報は
110 http://www.kernel.org/doc/man\-pages/ に書かれている。