FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
python-docs-ja/c-api/subinterpreters.po at refs/heads/3.15 · python/python-docs-ja · GitHub
python
python-docs-ja
Repository navigation
Code
Issues
Pull requests
Actions
Security and quality
Insights
Expand file tree
Breadcrumbs
python-docs-ja
/
c-api
/
subinterpreters.po
Copy path
More file actions
More file actions
Latest commit
History
History
History
804 lines (714 loc) · 40 KB
Breadcrumbs
python-docs-ja
/
c-api
/
subinterpreters.po
Copy path
File metadata and controls
804 lines (714 loc) · 40 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
#
SOME DESCRIPTIVE TITLE.
#
Copyright (C) 2001 Python Software Foundation
#
This file is distributed under the same license as the Python package.
#
FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#
Translators:
#
python-doc bot, 2026
#
Inada Naoki <songofacandy@gmail.com>, 2026
#
#,
fuzzy
msgid ""
msgstr ""
"
Project-Id-Version
:
Python 3.15\n
"
"
Report-Msgid-Bugs-To
:
\n
"
"
POT-Creation-Date
:
2026-10-25 17:19+0000\n
"
"
PO-Revision-Date
:
2026-02-25 14:46+0000\n
"
"
Last-Translator
:
Inada Naoki <songofacandy@gmail.com>, 2026\n
"
"
Language-Team
:
Japanese (https://app.transifex.com/python-doc/teams/5390/
"
"
ja/)\n
"
"
MIME-Version
:
1.0\n
"
"
Content-Type
:
text/plain; charset=UTF-8\n
"
"
Content-Transfer-Encoding
:
8bit\n
"
"
Language
:
ja\n
"
"
Plural-Forms
:
nplurals=1; plural=0;\n
"
msgid
"Multiple interpreters in a Python process"
msgstr
"Python プロセス内の複数のインタープリタ"
#:
../../c-api/subinterpreters.rst:8
msgid
""
"While in most uses, you will only embed a single Python interpreter, there "
"are cases where you need to create several independent interpreters in the "
"same process and perhaps even in the same thread. Sub-interpreters allow you "
"to do that."
msgstr
""
"ほとんどの場合は埋め込む Python インタプリタは1つだけですが、いくつかの場合に"
"同一プロセス内、あるいは同一スレッド内で、複数の独立したインタプリタを作成す"
"る必要があります。\n"
"これを可能にするのがサブインタプリタです。"
msgid
""
"The
\"
main
\"
interpreter is the first one created when the runtime "
"initializes. It is usually the only Python interpreter in a process. Unlike "
"sub-interpreters, the main interpreter has unique process-global "
"responsibilities like signal handling. It is also responsible for execution "
"during runtime initialization and is usually the active interpreter during "
"runtime finalization. The :c:func:`PyInterpreterState_Main` function "
"returns a pointer to its state."
msgstr
""
"「メイン」インタープリタは、ランタイムの初期化時に最初に作成されるインタープ"
"リタです。\n"
"通常、プロセス内の Python インタープリタはこれだけです。\n"
"サブインタープリタとは異なり、メインインタープリタはシグナル処理などの、プロ"
"セス全体に関わる固有の役割を担います。\n"
"ランタイムの初期化中の実行も担い、通常はランタイムの終了処理中にもアクティブ"
"なインタープリタです。\n"
":c:func:`PyInterpreterState_Main` は、その状態へのポインターを返します。"
#:
../../c-api/subinterpreters.rst:20
msgid
""
"You can switch between sub-interpreters using the :c:func:"
"`PyThreadState_Swap` function. You can create and destroy them using the "
"following functions:"
msgstr
""
"サブインタプリタを切り替えが :c:func:`PyThreadState_Swap` 関数でできます。\n"
"次の関数を使ってサブインタプリタの作成と削除が行えます:"
msgid
""
"Structure containing most parameters to configure a sub-interpreter. Its "
"values are used only in :c:func:`Py_NewInterpreterFromConfig` and never "
"modified by the runtime."
msgstr
""
"サブインタープリタの設定に使うパラメーターの大部分を含む構造体です。\n"
"値は :c:func:`Py_NewInterpreterFromConfig` でのみ使用され、ランタイムによって"
"変更されることはありません。"
#:
../../c-api/subinterpreters.rst:32
msgid
"Structure fields:"
msgstr
"構造体フィールド:"
msgid
""
"If this is ``0`` then the sub-interpreter will use its own
\"
object
\"
"
"allocator state. Otherwise it will use (share) the main interpreter's."
msgstr
""
"``0`` の場合、サブインタープリタは独自の「オブジェクト」アロケーターの状態を"
"使います。\n"
"それ以外の場合は、メインインタープリタの状態を共有して使います。"
msgid
""
"If this is ``0`` then :c:member:`~PyInterpreterConfig."
"check_multi_interp_extensions` must be ``1`` (non-zero). If this is ``1`` "
"then :c:member:`~PyInterpreterConfig.gil` must not be :c:macro:"
"`PyInterpreterConfig_OWN_GIL`."
msgstr
""
"``0`` の場合、:c:member:`~PyInterpreterConfig.check_multi_interp_extensions` "
"は ``1`` (ゼロ以外) でなければなりません。\n"
"``1`` の場合、:c:member:`~PyInterpreterConfig.gil` は :c:macro:"
"`PyInterpreterConfig_OWN_GIL` であってはなりません。"
msgid
""
"If this is ``0`` then the runtime will not support forking the process in "
"any thread where the sub-interpreter is currently active. Otherwise fork is "
"unrestricted."
msgstr
""
"``0`` の場合、このサブインタープリタが現在アクティブなスレッドでは、ランタイ"
"ムはプロセスの fork を許可しません。\n"
"それ以外の場合、fork に制限はありません。"
msgid
""
"Note that the :mod:`subprocess` module still works when fork is disallowed."
msgstr
"fork を許可しなくても、:mod:`subprocess` モジュールは動作します。"
msgid
""
"If this is ``0`` then the runtime will not support replacing the current "
"process via exec (e.g. :func:`os.execv`) in any thread where the sub-"
"interpreter is currently active. Otherwise exec is unrestricted."
msgstr
""
"``0`` の場合、このサブインタープリタが現在アクティブなスレッドでは、ランタイ"
"ムは exec (:func:`os.execv` など) による現在のプロセスの置き換えを許可しませ"
"ん。\n"
"それ以外の場合、exec に制限はありません。"
msgid
""
"Note that the :mod:`subprocess` module still works when exec is disallowed."
msgstr
"exec を許可しなくても、:mod:`subprocess` モジュールは動作します。"
msgid
""
"If this is ``0`` then the sub-interpreter's :mod:`threading` module won't "
"create threads. Otherwise threads are allowed."
msgstr
""
"``0`` の場合、このサブインタープリタの :mod:`threading` モジュールはスレッド"
"を作成しません。\n"
"それ以外の場合は、スレッドの作成が許可されます。"
msgid
""
"If this is ``0`` then the sub-interpreter's :mod:`threading` module won't "
"create daemon threads. Otherwise daemon threads are allowed (as long as :c:"
"member:`~PyInterpreterConfig.allow_threads` is non-zero)."
msgstr
""
"``0`` の場合、このサブインタープリタの :mod:`threading` モジュールはデーモン"
"スレッドを作成しません。\n"
"それ以外の場合は、:c:member:`~PyInterpreterConfig.allow_threads` がゼロでない"
"限り、デーモンスレッドの作成が許可されます。"
msgid
""
"If this is ``0`` then all extension modules may be imported, including "
"legacy (single-phase init) modules, in any thread where the sub-interpreter "
"is currently active. Otherwise only multi-phase init extension modules (see :"
"pep:`489`) may be imported. (Also see :c:macro:"
"`Py_mod_multiple_interpreters`.)"
msgstr
""
"``0`` の場合、このサブインタープリタが現在アクティブなスレッドでは、従来の単"
"相初期化モジュールを含め、すべての拡張モジュールをインポートできます。\n"
"それ以外の場合は、多相初期化を使う拡張モジュールのみインポートできます (:pep:"
"`489` を参照)。\n"
":c:macro:`Py_mod_multiple_interpreters` も参照してください。"
msgid
""
"This must be ``1`` (non-zero) if :c:member:`~PyInterpreterConfig."
"use_main_obmalloc` is ``0``."
msgstr
""
":c:member:`~PyInterpreterConfig.use_main_obmalloc` が ``0`` の場合は、``1`` "
"(ゼロ以外) でなければなりません。"
msgid
""
"This determines the operation of the GIL for the sub-interpreter. It may be "
"one of the following:"
msgstr
""
"サブインタープリタの GIL の動作を指定します。\n"
"次のいずれかの値を取ります。"
msgid
"Use the default selection (:c:macro:`PyInterpreterConfig_SHARED_GIL`)."
msgstr
""
"デフォルトの選択 (:c:macro:`PyInterpreterConfig_SHARED_GIL`) を使います。"
msgid
"Use (share) the main interpreter's GIL."
msgstr
"メインインタープリタの GIL を共有して使います。"
msgid
"Use the sub-interpreter's own GIL."
msgstr
"サブインタープリタ独自の GIL を使います。"
msgid
""
"If this is :c:macro:`PyInterpreterConfig_OWN_GIL` then :c:member:"
"`PyInterpreterConfig.use_main_obmalloc` must be ``0``."
msgstr
""
":c:macro:`PyInterpreterConfig_OWN_GIL` の場合、:c:member:"
"`PyInterpreterConfig.use_main_obmalloc` は ``0`` でなければなりません。"
#:
../../c-api/subinterpreters.rst:123
msgid
""
"Create a new sub-interpreter. This is an (almost) totally separate "
"environment for the execution of Python code. In particular, the new "
"interpreter has separate, independent versions of all imported modules, "
"including the fundamental modules :mod:`builtins`, :mod:`__main__` and :mod:"
"`sys`. The table of loaded modules (``sys.modules``) and the module search "
"path (``sys.path``) are also separate. The new environment has no ``sys."
"argv`` variable. It has new standard I/O stream file objects ``sys.stdin``, "
"``sys.stdout`` and ``sys.stderr`` (however these refer to the same "
"underlying file descriptors)."
msgstr
""
"新しいサブインタプリタ (sub-interpreter) を生成します。サブインタプリタとは、"
"(ほぼ完全に) 個別に分割された Python コードの実行環境です。特に、新しいサブイ"
"ンタプリタは、 import されるモジュール全てについて個別のバージョンを持ち、こ"
"れには基盤となるモジュール :mod:`builtins`, :mod:`__main__` および :mod:"
"`sys` も含まれます。ロード済みのモジュールからなるテーブル (``sys."
"modules``) およびモジュール検索パス (``sys.path``) もサブインタプリタ毎に別"
"個のものになります。新たなサブインタプリタ環境には ``sys.argv`` 変数がありま"
"せん。また、サブインタプリタは新たな標準 I/O ストリーム ``sys.stdin``, ``sys."
"stdout``, ``sys.stderr`` を持ちます (とはいえ、これらのストリームは根底にある"
"同じファイル記述子を参照しています)。"
msgid
""
"The given *config* controls the options with which the interpreter is "
"initialized."
msgstr
"*config* は、インタープリタの初期化に使うオプションを指定します。"
msgid
""
"Upon success, *tstate_p* will be set to the first :term:`thread state` "
"created in the new sub-interpreter. This thread state is :term:`attached "
"<attached thread state>`. Note that no actual thread is created; see the "
"discussion of thread states below. If creation of the new interpreter is "
"unsuccessful, *tstate_p* is set to ``NULL``; no exception is set since the "
"exception state is stored in the :term:`attached thread state`, which might "
"not exist."
msgstr
""
"成功時は、新しいサブインタープリタで最初に作成した :term:`スレッド状態 "
"<thread state>` が *tstate_p* に設定されます。\n"
"このスレッド状態は :term:`アタッチされています <attached thread state>`。\n"
"実際のスレッドは作成しないことに注意してください。\n"
"以下のスレッド状態についての説明を参照してください。\n"
"新しいインタープリタの作成に失敗すると、*tstate_p* は ``NULL`` に設定されま"
"す。\n"
"例外の状態は :term:`アタッチされたスレッド状態 <attached thread state>` に保"
"存されますが、それが存在しない場合もあるため、例外は設定されません。"
msgid
""
"Like all other Python/C API functions, an :term:`attached thread state` must "
"be present before calling this function, but it might be detached upon "
"returning. On success, the returned thread state will be :term:`attached "
"<attached thread state>`. If the sub-interpreter is created with its own :"
"term:`GIL` then the :term:`attached thread state` of the calling interpreter "
"will be detached. When the function returns, the new interpreter's :term:"
"`thread state` will be :term:`attached <attached thread state>` to the "
"current thread and the previous interpreter's :term:`attached thread state` "
"will remain detached."
msgstr
""
"ほかの Python/C API 関数と同様に、呼び出す前には :term:`アタッチされたスレッ"
"ド状態 <attached thread state>` が必要ですが、戻るときにはデタッチされている"
"場合があります。\n"
"成功時には、返されたスレッド状態が :term:`アタッチされています <attached "
"thread state>`。\n"
"独自の :term:`GIL` を持つサブインタープリタを作成した場合は、呼び出し元のイン"
"タープリタの :term:`アタッチされたスレッド状態 <attached thread state>` がデ"
"タッチされます。\n"
"関数が戻るときには、新しいインタープリタの :term:`スレッド状態 <thread "
"state>` が現在のスレッドに :term:`アタッチされ <attached thread state>`、元の"
"インタープリタの :term:`アタッチされていたスレッド状態 <attached thread "
"state>` はデタッチされたままです。"
msgid
""
"Sub-interpreters are most effective when isolated from each other, with "
"certain functionality restricted::"
msgstr
""
"サブインタープリタは、一部の機能を制限して互いに隔離したときに、最も効果を発"
"揮します。 ::"
msgid
""
"PyInterpreterConfig config = {\n"
" .use_main_obmalloc = 0,\n"
" .allow_fork = 0,\n"
" .allow_exec = 0,\n"
" .allow_threads = 1,\n"
" .allow_daemon_threads = 0,\n"
" .check_multi_interp_extensions = 1,\n"
" .gil = PyInterpreterConfig_OWN_GIL,\n"
"};\n"
"PyThreadState *tstate = NULL;\n"
"PyStatus status = Py_NewInterpreterFromConfig(&tstate, &config);\n"
"if (PyStatus_Exception(status)) {\n"
" Py_ExitStatusException(status);\n"
"}"
msgstr
""
"PyInterpreterConfig config = {\n"
" .use_main_obmalloc = 0,\n"
" .allow_fork = 0,\n"
" .allow_exec = 0,\n"
" .allow_threads = 1,\n"
" .allow_daemon_threads = 0,\n"
" .check_multi_interp_extensions = 1,\n"
" .gil = PyInterpreterConfig_OWN_GIL,\n"
"};\n"
"PyThreadState *tstate = NULL;\n"
"PyStatus status = Py_NewInterpreterFromConfig(&tstate, &config);\n"
"if (PyStatus_Exception(status)) {\n"
" Py_ExitStatusException(status);\n"
"}"
msgid
""
"Note that the config is used only briefly and does not get modified. During "
"initialization the config's values are converted into various :c:type:"
"`PyInterpreterState` values. A read-only copy of the config may be stored "
"internally on the :c:type:`PyInterpreterState`."
msgstr
""
"設定は短時間だけ使われ、変更されることはありません。\n"
"初期化中に、設定の値が :c:type:`PyInterpreterState` の各種の値に変換されま"
"す。\n"
"設定の読み取り専用のコピーが、:c:type:`PyInterpreterState` 内部に保存される場"
"合もあります。"
msgid
"Extension modules are shared between (sub-)interpreters as follows:"
msgstr
""
"拡張モジュールは、インタープリタ間 (サブインタープリタを含む) で次のように共"
"有されます。"
msgid
""
"For modules using multi-phase initialization, e.g. :c:func:"
"`PyModule_FromDefAndSpec`, a separate module object is created and "
"initialized for each interpreter. Only C-level static and global variables "
"are shared between these module objects."
msgstr
""
":c:func:`PyModule_FromDefAndSpec` などの多相初期化を使うモジュールでは、イン"
"タープリタごとに別のモジュールオブジェクトを作成して初期化します。\n"
"これらのモジュールオブジェクトが共有するのは、C レベルの静的変数とグローバル"
"変数だけです。"
msgid
""
"For modules using legacy :ref:`single-phase initialization <single-phase-"
"initialization>`, e.g. :c:func:`PyModule_Create`, the first time a "
"particular extension is imported, it is initialized normally, and a "
"(shallow) copy of its module's dictionary is squirreled away. When the same "
"extension is imported by another (sub-)interpreter, a new module is "
"initialized and filled with the contents of this copy; the extension's "
"``init`` function is not called. Objects in the module's dictionary thus end "
"up shared across (sub-)interpreters, which might cause unwanted behavior "
"(see `Bugs and caveats`_ below)."
msgstr
""
":c:func:`PyModule_Create` などの従来の :ref:`単相初期化 <single-phase-"
"initialization>` を使うモジュールでは、ある拡張を最初にインポートするときは通"
"常どおり初期化し、そのモジュールの辞書の浅いコピーを保存します。\n"
"別のインタープリタ (サブインタープリタを含む) が同じ拡張をインポートすると、"
"新しいモジュールを初期化して、保存したコピーの内容を設定します。\n"
"拡張の ``init`` 関数は呼び出しません。\n"
"その結果、モジュールの辞書内のオブジェクトがインタープリタ間で共有され、望ま"
"しくない動作を引き起こす可能性があります (以下の `Bugs and caveats`_ を参"
"照)。"
msgid
""
"Note that this is different from what happens when an extension is imported "
"after the interpreter has been completely re-initialized by calling :c:func:"
"`Py_FinalizeEx` and :c:func:`Py_Initialize`; in that case, the extension's "
"``initmodule`` function *is* called again. As with multi-phase "
"initialization, this means that only C-level static and global variables are "
"shared between these modules."
msgstr
""
":c:func:`Py_FinalizeEx` と :c:func:`Py_Initialize` を呼び出してインタープリタ"
"を完全に再初期化した後で、拡張をインポートする場合とは異なります。\n"
"その場合は、拡張の ``initmodule`` 関数が再び呼び出され *ます*。\n"
"多相初期化の場合と同様に、これらのモジュール間で共有されるのは、C レベルの静"
"的変数とグローバル変数だけです。"
msgid
""
"Create a new sub-interpreter. This is essentially just a wrapper around :c:"
"func:`Py_NewInterpreterFromConfig` with a config that preserves the existing "
"behavior. The result is an unisolated sub-interpreter that shares the main "
"interpreter's GIL, allows fork/exec, allows daemon threads, and allows "
"single-phase init modules."
msgstr
""
"新しいサブインタープリタを作成します。\n"
"基本的には、従来の動作を維持する設定で :c:func:`Py_NewInterpreterFromConfig` "
"を呼び出すラッパーです。\n"
"作成されるサブインタープリタは隔離されておらず、メインインタープリタの GIL を"
"共有し、fork/exec、デーモンスレッド、単相初期化モジュールを許可します。"
msgid
""
"Destroy the (sub-)interpreter represented by the given :term:`thread state`. "
"The given thread state must be :term:`attached <attached thread state>`. "
"When the call returns, there will be no :term:`attached thread state`. All "
"thread states associated with this interpreter are destroyed."
msgstr
""
"指定された :term:`スレッド状態 <thread state>` が表すインタープリタ (サブイン"
"タープリタを含む) を破棄します。\n"
"指定したスレッド状態は :term:`アタッチされていなければなりません <attached "
"thread state>`。\n"
"呼び出しから戻るときには、:term:`アタッチされたスレッド状態 <attached thread "
"state>` はありません。\n"
"このインタープリタに関連付けられたすべてのスレッド状態が破棄されます。"
msgid
""
":c:func:`Py_FinalizeEx` will destroy all sub-interpreters that haven't been "
"explicitly destroyed at that point."
msgstr
""
":c:func:`Py_FinalizeEx` は、その時点で明示的に破棄されていないサブインタープ"
"リタをすべて破棄します。"
msgid
"A per-interpreter GIL"
msgstr
"インタープリタごとの GIL"
msgid
""
"Using :c:func:`Py_NewInterpreterFromConfig` you can create a sub-interpreter "
"that is completely isolated from other interpreters, including having its "
"own GIL. The most important benefit of this isolation is that such an "
"interpreter can execute Python code without being blocked by other "
"interpreters or blocking any others. Thus a single Python process can truly "
"take advantage of multiple CPU cores when running Python code. The "
"isolation also encourages a different approach to concurrency than that of "
"just using threads. (See :pep:`554` and :pep:`684`.)"
msgstr
""
":c:func:`Py_NewInterpreterFromConfig` を使うと、独自の GIL を持つなど、ほかの"
"インタープリタから完全に隔離されたサブインタープリタを作成できます。\n"
"この隔離の最大の利点は、ほかのインタープリタにブロックされたり、ほかのイン"
"タープリタをブロックしたりせずに Python コードを実行できることです。\n"
"そのため、1 つの Python プロセスで Python コードを実行するときに、複数の CPU "
"コアを実際に活用できます。\n"
"また、隔離によって、単にスレッドを使うのとは異なる並行処理の方法も促されます "
"(:pep:`554` と :pep:`684` を参照)。"
msgid
""
"Using an isolated interpreter requires vigilance in preserving that "
"isolation. That especially means not sharing any objects or mutable state "
"without guarantees about thread-safety. Even objects that are otherwise "
"immutable (e.g. ``None``, ``(1, 5)``) can't normally be shared because of "
"the refcount. One simple but less-efficient approach around this is to use "
"a global lock around all use of some state (or object). Alternately, "
"effectively immutable objects (like integers or strings) can be made safe in "
"spite of their refcounts by making them :term:`immortal`. In fact, this has "
"been done for the builtin singletons, small integers, and a number of other "
"builtin objects."
msgstr
""
"隔離されたインタープリタを使うには、隔離を維持するよう注意しなければなりませ"
"ん。\n"
"特に、スレッドセーフである保証なしにオブジェクトや可変の状態を共有してはいけ"
"ません。\n"
"参照カウントがあるため、``None`` や ``(1, 5)`` のように、それ以外の点では不変"
"なオブジェクトであっても、通常は共有できません。\n"
"単純ですが効率の劣る回避策として、ある状態やオブジェクトを使うすべての操作を"
"グローバルなロックで保護する方法があります。\n"
"また、整数や文字列のように実質的に不変なオブジェクトは、:term:`不死 "
"<immortal>` にすることで、参照カウントがあっても安全にできます。\n"
"実際に、組み込みのシングルトン、小さい整数、その他多くの組み込みオブジェクト"
"にこの方法が使われています。"
msgid
""
"If you preserve isolation then you will have access to proper multi-core "
"computing without the complications that come with free-threading. Failure "
"to preserve isolation will expose you to the full consequences of free-"
"threading, including races and hard-to-debug crashes."
msgstr
""
"隔離を維持すれば、フリースレッド化に伴う複雑さなしに、複数のコアを使った計算"
"を行えます。\n"
"隔離を維持できなければ、競合状態やデバッグの難しいクラッシュなど、フリース"
"レッド化のあらゆる問題にさらされます。"
#:
../../c-api/subinterpreters.rst:277
msgid
""
"Aside from that, one of the main challenges of using multiple isolated "
"interpreters is how to communicate between them safely (not break isolation) "
"and efficiently. The runtime and stdlib do not provide any standard "
"approach to this yet. A future stdlib module would help mitigate the effort "
"of preserving isolation and expose effective tools for communicating (and "
"sharing) data between interpreters."
msgstr
""
#:
../../c-api/subinterpreters.rst:286
msgid
"Bugs and caveats"
msgstr
"バグと注意事項"
msgid
""
"Because sub-interpreters (and the main interpreter) are part of the same "
"process, the insulation between them isn't perfect --- for example, using "
"low-level file operations like :func:`os.close` they can (accidentally or "
"maliciously) affect each other's open files. Because of the way extensions "
"are shared between (sub-)interpreters, some extensions may not work "
"properly; this is especially likely when using single-phase initialization "
"or (static) global variables. It is possible to insert objects created in "
"one sub-interpreter into a namespace of another (sub-)interpreter; this "
"should be avoided if possible."
msgstr
""
"サブインタープリタとメインインタープリタは同じプロセスに属するため、相互の隔"
"離は完全ではありません。\n"
"例えば、:func:`os.close` のような低水準のファイル操作を使うと、誤って、あるい"
"は悪意を持って、ほかのインタープリタが開いたファイルに影響を与えられます。\n"
"また、拡張はインタープリタ間で共有されるため、正しく動作しないものもありま"
"す。\n"
"特に、単相初期化や静的なグローバル変数を使う場合に起こりやすくなります。\n"
"あるサブインタープリタで作成したオブジェクトを、別のインタープリタの名前空間"
"に挿入することもできますが、できるだけ避けるべきです。"
msgid
""
"Special care should be taken to avoid sharing user-defined functions, "
"methods, instances or classes between sub-interpreters, since import "
"operations executed by such objects may affect the wrong (sub-)interpreter's "
"dictionary of loaded modules. It is equally important to avoid sharing "
"objects from which the above are reachable."
msgstr
""
"サブインタープリタ間で、ユーザー定義の関数、メソッド、インスタンス、クラスを"
"共有しないよう、特に注意するべきです。\n"
"それらが実行するインポート操作によって、誤ったインタープリタのロード済みモ"
"ジュールの辞書に影響する可能性があるためです。\n"
"これらのオブジェクトにたどり着けるオブジェクトの共有を避けることも、同様に重"
"要です。"
#:
../../c-api/subinterpreters.rst:304
msgid
""
"Also note that combining this functionality with ``PyGILState_*`` APIs is "
"delicate, because these APIs assume a bijection between Python thread states "
"and OS-level threads, an assumption broken by the presence of sub-"
"interpreters. It is highly recommended that you don't switch sub-"
"interpreters between a pair of matching :c:func:`PyGILState_Ensure` and :c:"
"func:`PyGILState_Release` calls. Furthermore, extensions (such as :mod:"
"`ctypes`) using these APIs to allow calling of Python code from non-Python "
"created threads will probably be broken when using sub-interpreters."
msgstr
""
"サブインタプリタを ``PyGILState_*`` API と組み合わせるのが難しいことにも注意"
"してください。これらのAPIはPythonのスレッド状態とOSレベルスレッドが1対1で対応"
"していることを前提にしていて、サブインタプリタが存在するとその前提が崩れるか"
"らです。対応する :c:func:`PyGILState_Ensure` と :c:func:`PyGILState_Release` "
"の呼び出しのペアの間では、サブインタプリタの切り替えを行わないことを強く推奨"
"します。さらに、(:mod:`ctypes` のような)これらのAPIを使ってPythonの外で作られ"
"たスレッドから Pythonコードを実行している拡張モジュールはサブインタプリタを使"
"うと壊れる可能性があります。"
#:
../../c-api/subinterpreters.rst:315
msgid
"High-level APIs"
msgstr
"高水準 API"
#:
../../c-api/subinterpreters.rst:319
msgid
""
"This data structure represents the state shared by a number of cooperating "
"threads. Threads belonging to the same interpreter share their module "
"administration and a few other internal items. There are no public members "
"in this structure."
msgstr
""
"このデータ構造体は、協調動作する多数のスレッド間で共有されている状態を表現し"
"ます。同じインタプリタに属するスレッドはモジュール管理情報やその他いくつかの"
"内部的な情報を共有しています。この構造体には公開 (public) のメンバはありませ"
"ん。"
#:
../../c-api/subinterpreters.rst:324
msgid
""
"Threads belonging to different interpreters initially share nothing, except "
"process state like available memory, open file descriptors and such. The "
"global interpreter lock is also shared by all threads, regardless of to "
"which interpreter they belong."
msgstr
""
"異なるインタプリタに属するスレッド間では、利用可能なメモリ、開かれているファ"
"イルデスクリプタなどといったプロセス状態を除いて、初期状態では何も共有されて"
"いません。GILもまた、スレッドがどのインタプリタに属しているかに関わらずすべて"
"のスレッドで共有されています。"
msgid
""
":pep:`684` introduced the possibility of a :ref:`per-interpreter GIL <per-"
"interpreter-gil>`. See :c:func:`Py_NewInterpreterFromConfig`."
msgstr
""
":pep:`684` により、:ref:`インタープリタごとの GIL <per-interpreter-gil>` を持"
"てるようになりました。\n"
":c:func:`Py_NewInterpreterFromConfig` を参照してください。"
msgid
"Get the current interpreter."
msgstr
"現在のインタープリタを取得します。"
msgid
""
"Issue a fatal error if there is no :term:`attached thread state`. It cannot "
"return NULL."
msgstr
""
":term:`アタッチされたスレッド状態 <attached thread state>` がなければ、致命的"
"エラーを発生させます。\n"
"NULL を返すことはありません。"
#:
../../c-api/subinterpreters.rst:348
msgid
""
"Return the interpreter's unique ID. If there was any error in doing so then "
"``-1`` is returned and an error is set."
msgstr
""
"インタプリタの一意な ID を返します。\n"
"処理中に何かエラーが起きたら、 ``-1`` が返され、エラーがセットされます。"
msgid
"The caller must have an :term:`attached thread state`."
msgstr
""
"呼び出し元には :term:`スレッド状態がアタッチされていなければなりません "
"<attached thread state>`。"
#:
../../c-api/subinterpreters.rst:358
msgid
""
"Return a dictionary in which interpreter-specific data may be stored. If "
"this function returns ``NULL`` then no exception has been raised and the "
"caller should assume no interpreter-specific dict is available."
msgstr
""
"インタプリタ固有のデータを保持している辞書を返します。\n"
"この関数が ``NULL`` を返した場合は、ここまでで例外は送出されておらず、呼び出"
"し側はインタプリタ固有の辞書は利用できないと考えなければなりません。"
msgid
""
"This is not a replacement for :c:func:`PyModule_GetState()`, which "
"extensions should use to store interpreter-specific state information."
msgstr
""
"これは :c:func:`PyModule_GetState()` の代わりにはなりません。\n"
"拡張がインタープリタ固有の状態情報を保存するには、そちらを使うべきです。"
msgid
""
"The returned dictionary is borrowed from the interpreter and is valid until "
"interpreter shutdown."
msgstr
""
"返される辞書は、インタープリタからの借用参照であり、インタープリタの終了まで"
"有効です。"
msgid
"Type of a frame evaluation function."
msgstr
"フレーム評価関数の型。"
msgid
""
"The *throwflag* parameter is used by the ``throw()`` method of generators: "
"if non-zero, handle the current exception."
msgstr
""
"*throwflag* 引数は、ジェネレーターの ``throw()`` メソッドが使います。\n"
"ゼロ以外の場合は、現在の例外を処理します。"
msgid
"The function now takes a *tstate* parameter."
msgstr
"*tstate* 引数を受け取るようになりました。"
msgid
""
"The *frame* parameter changed from ``PyFrameObject*`` to "
"``_PyInterpreterFrame*``."
msgstr
""
"*frame* 引数が ``PyFrameObject*`` から ``_PyInterpreterFrame*`` に変わりまし"
"た。"
msgid
"Get the frame evaluation function."
msgstr
"フレーム評価関数を取得します。"
msgid
"See the :pep:`523`
\"
Adding a frame evaluation API to CPython
\"
."
msgstr
""
":pep:`523` 「Adding a frame evaluation API to CPython」を参照してください。"
msgid
"Set the frame evaluation function."
msgstr
"フレーム評価関数を設定します。"
msgid
""
"Enables or disables specialization why a custom frame evaluator is in place."
msgstr
"カスタムのフレーム評価器を使うときの特殊化を、有効または無効にします。"
msgid
""
"If *allow_specialization* is non-zero, the adaptive specializer will "
"continue to specialize bytecodes even though a custom eval frame function is "
"set. When *allow_specialization* is zero, setting a custom eval frame "
"disables specialization. The standard interpreter loop will continue to "
"deopt while a frame evaluation API is in place - the frame evaluation "
"function needs to handle the specialized opcodes to take advantage of this."
msgstr
""
"*allow_specialization* がゼロ以外の場合、カスタムのフレーム評価関数が設定され"
"ていても、適応的な特殊化によるバイトコードの特殊化を継続します。\n"
"*allow_specialization* がゼロの場合、カスタムのフレーム評価関数を設定すると特"
"殊化が無効になります。\n"
"フレーム評価 API を使用している間、標準のインタープリタループは特殊化を解除し"
"続けます。\n"
"この機能を活用するには、フレーム評価関数が特殊化されたオペコードを処理する必"
"要があります。"
msgid
""
"Return non-zero if adaptive specialization is enabled for the interpreter. "
"Specialization is enabled when no custom eval frame function is set, or when "
"one is set with *allow_specialization* enabled."
msgstr
""
"インタープリタで適応的な特殊化が有効なら、ゼロ以外を返します。\n"
"カスタムのフレーム評価関数が設定されていない場合や、設定されていても "
"*allow_specialization* が有効な場合には、特殊化が有効です。"
#:
../../c-api/subinterpreters.rst:425
msgid
"Low-level APIs"
msgstr
"低水準 API"
#:
../../c-api/subinterpreters.rst:427
msgid
""
"All of the following functions must be called after :c:func:`Py_Initialize`."
msgstr
""
"次の全ての関数は :c:func:`Py_Initialize` の後に呼び出さなければなりません。"
msgid
""
":c:func:`Py_Initialize()` now initializes the :term:`GIL` and sets an :term:"
"`attached thread state`."
msgstr
""
":c:func:`Py_Initialize()` が :term:`GIL` を初期化し、:term:`スレッド状態をア"
"タッチ <attached thread state>` するようになりました。"
msgid
""
"Create a new interpreter state object. An :term:`attached thread state` is "
"not needed, but may optionally exist if it is necessary to serialize calls "
"to this function."
msgstr
""
"新しいインタープリタ状態オブジェクトを作成します。\n"
":term:`アタッチされたスレッド状態 <attached thread state>` は必要ありません"
"が、この関数の呼び出しを直列化する必要があれば、存在しても構いません。"
msgid
""
"Raises an :ref:`auditing event <auditing>` ``cpython."
"PyInterpreterState_New`` with no arguments."
msgstr
""
"引数無しで :ref:`監査イベント <auditing>` ``cpython.PyInterpreterState_New`` "
"を送出します。"
msgid
""
"Reset all information in an interpreter state object. There must be an :"
"term:`attached thread state` for the interpreter."
msgstr
""
"インタープリタ状態オブジェクトのすべての情報をリセットします。\n"
"そのインタープリタの :term:`スレッド状態がアタッチされていなければなりません "
"<attached thread state>`。"
msgid
""
"Raises an :ref:`auditing event <auditing>` ``cpython."
"PyInterpreterState_Clear`` with no arguments."
msgstr
""
"引数無しで :ref:`監査イベント <auditing>` ``cpython."
"PyInterpreterState_Clear`` を送出します。"
msgid
""
"Destroy an interpreter state object. There **should not** be an :term:"
"`attached thread state` for the target interpreter. The interpreter state "
"must have been reset with a previous call to :c:func:"
"`PyInterpreterState_Clear`."
msgstr
""
"インタープリタ状態オブジェクトを破棄します。\n"
"対象のインタープリタの :term:`スレッド状態がアタッチされていてはなりません "
"<attached thread state>`。\n"
"インタープリタ状態は、事前に :c:func:`PyInterpreterState_Clear` を呼び出して"
"リセットしておく必要があります。"
msgid
"Advanced debugger support"
msgstr
"高度なデバッガーのサポート"
#:
../../c-api/subinterpreters.rst:463
msgid
""
"These functions are only intended to be used by advanced debugging tools."
msgstr
"以下の関数は高度なデバッグツールでの使用のためだけのものです。"
#:
../../c-api/subinterpreters.rst:468
msgid
""
"Return the interpreter state object at the head of the list of all such "
"objects."
msgstr
""
"インタプリタ状態オブジェクトからなるリストのうち、先頭にあるものを返します。"
#:
../../c-api/subinterpreters.rst:473
msgid
"Return the main interpreter state object."
msgstr
"メインインタプリタの状態オブジェクトを返します。"
#:
../../c-api/subinterpreters.rst:478
msgid
""
"Return the next interpreter state object after *interp* from the list of all "
"such objects."
msgstr
""
"インタプリタ状態オブジェクトからなるリストのうち、*interp* の次にあるものを返"
"します。"
#:
../../c-api/subinterpreters.rst:484
msgid
""
"Return the pointer to the first :c:type:`PyThreadState` object in the list "
"of threads associated with the interpreter *interp*."
msgstr
""
"インタプリタ *interp* に関連付けられているスレッドからなるリストのうち、先頭"
"にある :c:type:`PyThreadState` オブジェクトを返します。"
#:
../../c-api/subinterpreters.rst:490
msgid
""
"Return the next thread state object after *tstate* from the list of all such "
"objects belonging to the same :c:type:`PyInterpreterState` object."
msgstr
""
"*tstate* と同じ :c:type:`PyInterpreterState` オブジェクトに属しているスレッド"
"状態オブジェクトのうち、 *tstate* の次にあるものを返します。"
#:
../../c-api/subinterpreters.rst:115
../../c-api/subinterpreters.rst:215
msgid
"module"
msgstr
"module"
#:
../../c-api/subinterpreters.rst:115
../../c-api/subinterpreters.rst:215
msgid
"builtins"
msgstr
"builtins"
#:
../../c-api/subinterpreters.rst:115
../../c-api/subinterpreters.rst:215
msgid
"__main__"
msgstr
"__main__"
#:
../../c-api/subinterpreters.rst:115
../../c-api/subinterpreters.rst:215
msgid
"sys"
msgstr
"sys"
#:
../../c-api/subinterpreters.rst:115
../../c-api/subinterpreters.rst:215
msgid
"stdout (in module sys)"
msgstr
"stdout (sys モジュール)"
#:
../../c-api/subinterpreters.rst:115
../../c-api/subinterpreters.rst:215
msgid
"stderr (in module sys)"
msgstr
"stderr (sys モジュール)"
#:
../../c-api/subinterpreters.rst:115
../../c-api/subinterpreters.rst:215
msgid
"stdin (in module sys)"
msgstr
"stdin (sys モジュール)"
msgid
"Py_FinalizeEx (C function)"
msgstr
"Py_FinalizeEx (C の関数)"
msgid
"Py_Initialize (C function)"
msgstr
"Py_Initialize (C の関数)"
msgid
"close (in module os)"
msgstr
"close (os モジュール)"
Back
|
FazBrowse Home
|
New Git URL