FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
python-docs-de/builtins/threadsafety.po at sync-upstream-3.15 · python/python-docs-de · GitHub
python
python-docs-de
Repository navigation
Code
Issues
Pull requests
2
(2)
Actions
Security and quality
Insights
Expand file tree
Breadcrumbs
python-docs-de
/
builtins
/
threadsafety.po
Copy path
More file actions
More file actions
Latest commit
History
History
History
1185 lines (1063 loc) · 46.5 KB
Breadcrumbs
python-docs-de
/
builtins
/
threadsafety.po
Copy path
File metadata and controls
1185 lines (1063 loc) · 46.5 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
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#
German translation of the Python documentation.
#
Copyright (C) 2001 Python Software Foundation
#
This file is distributed under the same license as the Python package.
#
#
Translators:
#
Swen Bachmann, 2026
#
msgid ""
msgstr ""
"
Project-Id-Version
:
Python 3.15\n
"
"
Report-Msgid-Bugs-To
:
\n
"
"
POT-Creation-Date
:
2026-10-26 03:10+0000\n
"
"
PO-Revision-Date
:
2026-10-15 22:50+0200\n
"
"
Last-Translator
:
Automatically generated\n
"
"
Language-Team
:
German (https://github.com/python/python-docs-de)\n
"
"
Language
:
de\n
"
"
MIME-Version
:
1.0\n
"
"
Content-Type
:
text/plain; charset=UTF-8\n
"
"
Content-Transfer-Encoding
:
8bit\n
"
"
Plural-Forms
:
nplurals=2; plural=(n != 1);\n
"
#:
../../builtins/threadsafety.rst:5
msgid
"Thread Safety Guarantees"
msgstr
"Garantien zur Threadsicherheit"
#:
../../builtins/threadsafety.rst:7
msgid
""
"This page documents thread-safety guarantees for built-in types in Python's "
"free-threaded build. The guarantees described here apply when using Python "
"with the :term:`GIL` disabled (free-threaded mode). When the GIL is enabled, "
"most operations are implicitly serialized."
msgstr
""
"Diese Seite dokumentiert die Garantien zur Threadsicherheit für eingebaute "
"Typen im Build mit freien Threads von Python. Die hier beschriebenen "
"Garantien gelten, wenn Python mit abgeschaltetem :term:`GIL` läuft (Modus "
"mit freien Threads). Ist der GIL eingeschaltet, werden die meisten "
"Operationen implizit serialisiert."
#:
../../builtins/threadsafety.rst:12
msgid
""
"For general guidance on writing thread-safe code in free-threaded Python, "
"see :ref:`freethreading-python-howto`."
msgstr
""
"Allgemeine Hinweise zum Schreiben threadsicheren Codes in Python mit freien "
"Threads findest du unter :ref:`freethreading-python-howto`."
#:
../../builtins/threadsafety.rst:19
msgid
"Thread safety levels"
msgstr
"Stufen der Threadsicherheit"
#:
../../builtins/threadsafety.rst:21
msgid
""
"The C API documentation uses the following levels to describe the thread "
"safety guarantees of each function. The levels are listed from least to most "
"safe."
msgstr
""
"Die Dokumentation des C-API verwendet die folgenden Stufen, um die Garantien "
"zur Threadsicherheit jeder Funktion zu beschreiben. Die Stufen sind von der "
"unsichersten zur sichersten aufgeführt."
#:
../../builtins/threadsafety.rst:28
msgid
"Incompatible"
msgstr
"Unverträglich"
#:
../../builtins/threadsafety.rst:30
msgid
""
"A function or operation that cannot be made safe for concurrent use even "
"with external synchronization. Incompatible code typically accesses global "
"state in an unsynchronized way and must only be called from a single thread "
"throughout the program's lifetime."
msgstr
""
"Eine Funktion oder Operation, die sich auch mit äußerer Synchronisierung "
"nicht für die gleichzeitige Verwendung sicher machen lässt. Unverträglicher "
"Code greift typischerweise unsynchronisiert auf globalen Zustand zu und darf "
"während der gesamten Laufzeit des Programms nur aus einem einzigen Thread "
"aufgerufen werden."
#:
../../builtins/threadsafety.rst:35
msgid
""
"Example: a function that modifies process-wide state such as signal handlers "
"or environment variables, where concurrent calls from any threads, even with "
"external locking, can conflict with the runtime or other libraries."
msgstr
""
"Beispiel: eine Funktion, die prozessweiten Zustand wie Signal-Handler oder "
"Umgebungsvariablen verändert, bei der gleichzeitige Aufrufe aus beliebigen "
"Threads selbst mit äußerer Sperre mit der Laufzeitumgebung oder anderen "
"Bibliotheken in Konflikt geraten können."
#:
../../builtins/threadsafety.rst:42
msgid
"Compatible"
msgstr
"Verträglich"
#:
../../builtins/threadsafety.rst:44
msgid
""
"A function or operation that is safe to call from multiple threads "
"*provided* the caller supplies appropriate external synchronization, for "
"example by holding a :term:`lock` for the duration of each call. Without "
"such synchronization, concurrent calls may produce :term:`race conditions "
"<race condition>` or :term:`data races <data race>`."
msgstr
""
"Eine Funktion oder Operation, die sich sicher aus mehreren Threads aufrufen "
"lässt, *vorausgesetzt*, der Aufrufer sorgt für geeignete äußere "
"Synchronisierung, etwa indem er für die Dauer jedes Aufrufs eine :term:"
"`Sperre <lock>` hält. Ohne solche Synchronisierung können gleichzeitige "
"Aufrufe zu :term:`Race-Conditions <race condition>` oder :term:"
"`Datenkonflikten <data race>` führen."
#:
../../builtins/threadsafety.rst:50
msgid
""
"Example: a function that reads from or writes to an object whose internal "
"state is not protected by a lock. Callers must ensure that no two threads "
"access the same object at the same time."
msgstr
""
"Beispiel: eine Funktion, die aus einem Objekt liest oder in es schreibt, "
"dessen interner Zustand nicht durch eine Sperre geschützt ist. Aufrufer "
"müssen sicherstellen, dass niemals zwei Threads gleichzeitig auf dasselbe "
"Objekt zugreifen."
#:
../../builtins/threadsafety.rst:57
msgid
"Safe on distinct objects"
msgstr
"Sicher auf verschiedenen Objekten"
#:
../../builtins/threadsafety.rst:59
msgid
""
"A function or operation that is safe to call from multiple threads without "
"external synchronization, as long as each thread operates on a **different** "
"object. Two threads may call the function at the same time, but they must "
"not pass the same object (or objects that share underlying state) as "
"arguments."
msgstr
""
"Eine Funktion oder Operation, die sich ohne äußere Synchronisierung sicher "
"aus mehreren Threads aufrufen lässt, solange jeder Thread auf einem "
"**anderen** Objekt arbeitet. Zwei Threads dürfen die Funktion gleichzeitig "
"aufrufen, sie dürfen ihr aber nicht dasselbe Objekt (oder Objekte, die sich "
"zugrunde liegenden Zustand teilen) als Argument übergeben."
#:
../../builtins/threadsafety.rst:65
msgid
""
"Example: a function that modifies fields of a struct using non-atomic "
"writes. Two threads can each call the function on their own struct instance "
"safely, but concurrent calls on the *same* instance require external "
"synchronization."
msgstr
""
"Beispiel: eine Funktion, die Felder eines Structs mit nicht atomaren "
"Schreibzugriffen verändert. Zwei Threads können die Funktion jeweils sicher "
"auf ihrer eigenen Struct-Instanz aufrufen, gleichzeitige Aufrufe auf "
"*derselben* Instanz brauchen aber äußere Synchronisierung."
#:
../../builtins/threadsafety.rst:73
msgid
"Safe on shared objects"
msgstr
"Sicher auf gemeinsam genutzten Objekten"
#:
../../builtins/threadsafety.rst:75
msgid
""
"A function or operation that is safe for concurrent use on the **same** "
"object. The implementation uses internal synchronization (such as :term:`per-"
"object locks <per-object lock>` or :ref:`critical sections <python-critical-"
"section-api>`) to protect shared mutable state, so callers do not need to "
"supply their own locking."
msgstr
""
"Eine Funktion oder Operation, die sich sicher gleichzeitig auf **demselben** "
"Objekt verwenden lässt. Die Umsetzung verwendet innere Synchronisierung "
"(etwa :term:`objektspezifische Sperren <per-object lock>` oder :ref:"
"`kritische Abschnitte <python-critical-section-api>`), um gemeinsam "
"genutzten veränderbaren Zustand zu schützen; Aufrufer müssen also nicht "
"selbst sperren."
#:
../../builtins/threadsafety.rst:81
msgid
""
"Example: :c:func:`PyList_GetItemRef` can be called from multiple threads on "
"the same :c:type:`PyListObject` - it uses internal synchronization to "
"serialize access."
msgstr
""
"Beispiel: :c:func:`PyList_GetItemRef` lässt sich aus mehreren Threads auf "
"demselben :c:type:`PyListObject` aufrufen – die Funktion verwendet innere "
"Synchronisierung, um die Zugriffe zu serialisieren."
#:
../../builtins/threadsafety.rst:88
msgid
"Atomic"
msgstr
"Atomar"
#:
../../builtins/threadsafety.rst:90
msgid
""
"A function or operation that appears :term:`atomic <atomic operation>` with "
"respect to other threads - it executes instantaneously from the perspective "
"of other threads. This is the strongest form of thread safety."
msgstr
""
"Eine Funktion oder Operation, die anderen Threads gegenüber :term:`atomar "
"<atomic operation>` erscheint – aus Sicht der anderen Threads läuft sie "
"augenblicklich ab. Das ist die stärkste Form der Threadsicherheit."
#:
../../builtins/threadsafety.rst:94
msgid
""
"Example: :c:func:`PyMutex_IsLocked` performs an atomic read of the mutex "
"state and can be called from any thread at any time."
msgstr
""
"Beispiel: :c:func:`PyMutex_IsLocked` liest den Zustand des Mutex atomar und "
"lässt sich jederzeit aus jedem Thread aufrufen."
#:
../../builtins/threadsafety.rst:101
msgid
"Thread safety for list objects"
msgstr
"Threadsicherheit bei list-Objekten"
#:
../../builtins/threadsafety.rst:103
msgid
""
"Reading a single element from a :class:`list` is :term:`atomic <atomic "
"operation>`:"
msgstr
""
"Ein einzelnes Element aus einer :class:`list` zu lesen ist :term:`atomar "
"<atomic operation>`:"
#:
../../builtins/threadsafety.rst:106
msgid
"lst[i] # list.__getitem__"
msgstr
"lst[i] # list.__getitem__"
#:
../../builtins/threadsafety.rst:111
msgid
""
"The following methods traverse the list and use :term:`atomic <atomic "
"operation>` reads of each item to perform their function. That means that "
"they may return results affected by concurrent modifications:"
msgstr
""
"Die folgenden Methoden durchlaufen die Liste und verwenden :term:`atomare "
"<atomic operation>` Lesezugriffe auf jedes Element, um ihre Aufgabe zu "
"erfüllen. Das heißt, dass sie Ergebnisse zurückgeben können, die von "
"gleichzeitigen Änderungen beeinflusst sind:"
#:
../../builtins/threadsafety.rst:115
msgid
""
"item in lst\n"
"lst.index(item)\n"
"lst.count(item)"
msgstr
""
"item in lst\n"
"lst.index(item)\n"
"lst.count(item)"
#:
../../builtins/threadsafety.rst:122
msgid
""
"All of the above operations avoid acquiring :term:`per-object locks <per-"
"object lock>`. They do not block concurrent modifications. Other operations "
"that hold a lock will not block these from observing intermediate states."
msgstr
""
"Alle obigen Operationen vermeiden das Erwerben :term:`objektspezifischer "
"Sperren <per-object lock>`. Sie blockieren gleichzeitige Änderungen nicht. "
"Andere Operationen, die eine Sperre halten, verhindern nicht, dass diese "
"hier Zwischenzustände beobachten."
#:
../../builtins/threadsafety.rst:127
msgid
""
"All other operations from here on block using the :term:`per-object lock`."
msgstr
""
"Alle weiteren Operationen von hier an blockieren über die :term:"
"`objektspezifische Sperre <per-object lock>`."
#:
../../builtins/threadsafety.rst:129
msgid
""
"Writing a single item via ``lst[i] = x`` is safe to call from multiple "
"threads and will not corrupt the list."
msgstr
""
"Ein einzelnes Element über ``lst[i] = x`` zu schreiben lässt sich sicher aus "
"mehreren Threads aufrufen und beschädigt die Liste nicht."
#:
../../builtins/threadsafety.rst:132
msgid
""
"The following operations return new objects and appear :term:`atomic <atomic "
"operation>` to other threads:"
msgstr
""
"Die folgenden Operationen geben neue Objekte zurück und erscheinen anderen "
"Threads :term:`atomar <atomic operation>`:"
#:
../../builtins/threadsafety.rst:135
msgid
""
"lst1 + lst2 # concatenates two lists into a new list\n"
"x * lst # repeats lst x times into a new list\n"
"lst.copy() # returns a shallow copy of the list"
msgstr
""
"lst1 + lst2 # verkettet zwei Listen zu einer neuen Liste\n"
"x * lst # wiederholt lst x-mal in einer neuen Liste\n"
"lst.copy() # gibt eine flache Kopie der Liste zurück"
#:
../../builtins/threadsafety.rst:142
msgid
""
"The following methods that only operate on a single element with no shifting "
"required are :term:`atomic <atomic operation>`:"
msgstr
""
"Die folgenden Methoden, die nur auf einem einzelnen Element arbeiten und "
"kein Verschieben erfordern, sind :term:`atomar <atomic operation>`:"
#:
../../builtins/threadsafety.rst:145
msgid
""
"lst.append(x) # append to the end of the list, no shifting required\n"
"lst.pop() # pop element from the end of the list, no shifting required"
msgstr
""
"lst.append(x) # hängt am Ende der Liste an, kein Verschieben nötig\n"
"lst.pop() # entnimmt ein Element am Ende der Liste, kein Verschieben "
"nötig"
#:
../../builtins/threadsafety.rst:151
msgid
""
"The :meth:`~list.clear` method is also :term:`atomic <atomic operation>`. "
"Other threads cannot observe elements being removed."
msgstr
""
"Die Methode :meth:`~list.clear` ist ebenfalls :term:`atomar <atomic "
"operation>`. Andere Threads können das Entfernen der Elemente nicht "
"beobachten."
#:
../../builtins/threadsafety.rst:154
msgid
""
"The :meth:`~list.sort` method is not :term:`atomic <atomic operation>`. "
"Other threads cannot observe intermediate states during sorting, but the "
"list appears empty for the duration of the sort."
msgstr
""
"Die Methode :meth:`~list.sort` ist nicht :term:`atomar <atomic operation>`. "
"Andere Threads können zwar keine Zwischenzustände während des Sortierens "
"beobachten, die Liste erscheint aber für die Dauer des Sortierens leer."
#:
../../builtins/threadsafety.rst:158
msgid
""
"The following operations may allow :term:`lock-free` operations to observe "
"intermediate states since they modify multiple elements in place:"
msgstr
""
"Die folgenden Operationen können :term:`sperrfreien <lock-free>` Operationen "
"erlauben, Zwischenzustände zu beobachten, denn sie verändern mehrere "
"Elemente an Ort und Stelle:"
#:
../../builtins/threadsafety.rst:161
msgid
""
"lst.insert(idx, item) # shifts elements\n"
"lst.pop(idx) # idx not at the end of the list, shifts elements\n"
"lst *= x # copies elements in place"
msgstr
""
"lst.insert(idx, item) # verschiebt Elemente\n"
"lst.pop(idx) # idx nicht am Ende der Liste, verschiebt Elemente\n"
"lst *= x # kopiert Elemente an Ort und Stelle"
#:
../../builtins/threadsafety.rst:168
msgid
""
"The :meth:`~list.remove` method may allow concurrent modifications since "
"element comparison may execute arbitrary Python code (via :meth:`~object."
"__eq__`)."
msgstr
""
"Die Methode :meth:`~list.remove` kann gleichzeitige Änderungen zulassen, "
"weil der Vergleich der Elemente beliebigen Python-Code ausführen kann (über :"
"meth:`~object.__eq__`)."
#:
../../builtins/threadsafety.rst:172
msgid
""
":meth:`~list.extend` is safe to call from multiple threads. However, its "
"guarantees depend on the iterable passed to it. If it is a :class:`list`, a :"
"class:`tuple`, a :class:`set`, a :class:`frozenset`, a :class:`dict` or a :"
"ref:`dictionary view object <dict-views>` (but not their subclasses), the "
"``extend`` operation is safe from concurrent modifications to the iterable. "
"Otherwise, an iterator is created which can be concurrently modified by "
"another thread. The same applies to inplace concatenation of a list with "
"other iterables when using ``lst += iterable``."
msgstr
""
":meth:`~list.extend` lässt sich sicher aus mehreren Threads aufrufen. Die "
"Garantien hängen allerdings vom übergebenen Iterable ab. Ist es eine :class:"
"`list`, ein :class:`tuple`, ein :class:`set`, ein :class:`frozenset`, ein :"
"class:`dict` oder ein :ref:`Dictionary-View-Objekt <dict-views>` (nicht aber "
"eine Unterklasse davon), dann ist die ``extend``-Operation vor "
"gleichzeitigen Änderungen am Iterable sicher. Andernfalls wird ein Iterator "
"erzeugt, der von einem anderen Thread gleichzeitig verändert werden kann. "
"Dasselbe gilt für das Verketten einer Liste mit anderen Iterables an Ort und "
"Stelle über ``lst += iterable``."
#:
../../builtins/threadsafety.rst:181
msgid
""
"Similarly, assigning to a list slice with ``lst[i:j] = iterable`` is safe to "
"call from multiple threads, but ``iterable`` is only locked when it is also "
"a :class:`list` (but not its subclasses)."
msgstr
""
"Ebenso lässt sich die Zuweisung an ein Listen-Slice über ``lst[i:j] = "
"iterable`` sicher aus mehreren Threads aufrufen, ``iterable`` wird aber nur "
"dann gesperrt, wenn es ebenfalls eine :class:`list` ist (nicht aber eine "
"Unterklasse davon)."
#:
../../builtins/threadsafety.rst:185
msgid
""
"Operations that involve multiple accesses, as well as iteration, are never "
"atomic. For example:"
msgstr
""
"Operationen mit mehreren Zugriffen sowie das Iterieren sind nie atomar. Zum "
"Beispiel:"
#:
../../builtins/threadsafety.rst:188
msgid
""
"# NOT atomic: read-modify-write\n"
"lst[i] = lst[i] + 1\n"
"\n"
"# NOT atomic: check-then-act\n"
"if lst:\n"
" item = lst.pop()\n"
"\n"
"# NOT thread-safe: iteration while modifying\n"
"for item in lst:\n"
" process(item) # another thread may modify lst"
msgstr
""
"# NICHT atomar: lesen, ändern, schreiben\n"
"lst[i] = lst[i] + 1\n"
"\n"
"# NICHT atomar: prüfen, dann handeln\n"
"if lst:\n"
" item = lst.pop()\n"
"\n"
"# NICHT threadsicher: iterieren während des Änderns\n"
"for item in lst:\n"
" process(item) # ein anderer Thread kann lst verändern"
#:
../../builtins/threadsafety.rst:202
msgid
""
"Consider external synchronization when sharing :class:`list` instances "
"across threads."
msgstr
""
"Zieh äußere Synchronisierung in Erwägung, wenn du :class:`list`-Instanzen "
"über Threads hinweg gemeinsam nutzt."
#:
../../builtins/threadsafety.rst:209
msgid
"Thread safety for dict objects"
msgstr
"Threadsicherheit bei dict-Objekten"
#:
../../builtins/threadsafety.rst:211
msgid
""
"Creating a dictionary with the :class:`dict` constructor is atomic when the "
"argument to it is a :class:`dict` or a :class:`tuple`. When using the :meth:"
"`dict.fromkeys` method, dictionary creation is atomic when the argument is "
"a :class:`dict`, :class:`tuple`, :class:`set` or :class:`frozenset`."
msgstr
""
"Ein Dictionary mit dem Konstruktor :class:`dict` zu erzeugen ist atomar, "
"wenn das Argument ein :class:`dict` oder ein :class:`tuple` ist. Bei der "
"Methode :meth:`dict.fromkeys` ist das Erzeugen des Dictionarys atomar, wenn "
"das Argument ein :class:`dict`, :class:`tuple`, :class:`set` oder :class:"
"`frozenset` ist."
#:
../../builtins/threadsafety.rst:217
msgid
""
"The following operations and functions are :term:`lock-free` and :term:"
"`atomic <atomic operation>`."
msgstr
""
"Die folgenden Operationen und Funktionen sind :term:`sperrfrei <lock-free>` "
"und :term:`atomar <atomic operation>`."
#:
../../builtins/threadsafety.rst:220
msgid
""
"d[key] # dict.__getitem__\n"
"d.get(key) # dict.get\n"
"key in d # dict.__contains__\n"
"len(d) # dict.__len__"
msgstr
""
"d[key] # dict.__getitem__\n"
"d.get(key) # dict.get\n"
"key in d # dict.__contains__\n"
"len(d) # dict.__len__"
#:
../../builtins/threadsafety.rst:228
msgid
"All other operations from here on hold the :term:`per-object lock`."
msgstr
""
"Alle weiteren Operationen von hier an halten die :term:`objektspezifische "
"Sperre <per-object lock>`."
#:
../../builtins/threadsafety.rst:230
msgid
""
"Writing or removing a single item is safe to call from multiple threads and "
"will not corrupt the dictionary:"
msgstr
""
"Ein einzelnes Element zu schreiben oder zu entfernen lässt sich sicher aus "
"mehreren Threads aufrufen und beschädigt das Dictionary nicht:"
#:
../../builtins/threadsafety.rst:233
msgid
""
"d[key] = value # write\n"
"del d[key] # delete\n"
"d.pop(key) # remove and return\n"
"d.popitem() # remove and return last item\n"
"d.setdefault(key, v) # insert if missing"
msgstr
""
"d[key] = value # schreiben\n"
"del d[key] # löschen\n"
"d.pop(key) # entfernen und zurückgeben\n"
"d.popitem() # letzten Eintrag entfernen und zurückgeben\n"
"d.setdefault(key, v) # einfügen, falls nicht vorhanden"
#:
../../builtins/threadsafety.rst:242
msgid
""
"These operations may compare keys using :meth:`~object.__eq__`, which can "
"execute arbitrary Python code. During such comparisons, the dictionary may "
"be modified by another thread. For built-in types like :class:`str`, :class:"
"`int`, and :class:`float`, that implement :meth:`~object.__eq__` in C, the "
"underlying lock is not released during comparisons and this is not a concern."
msgstr
""
"Diese Operationen können Schlüssel über :meth:`~object.__eq__` vergleichen, "
"was beliebigen Python-Code ausführen kann. Während solcher Vergleiche kann "
"das Dictionary von einem anderen Thread verändert werden. Bei eingebauten "
"Typen wie :class:`str`, :class:`int` und :class:`float`, die :meth:`~object."
"__eq__` in C umsetzen, wird die zugrunde liegende Sperre während der "
"Vergleiche nicht freigegeben. Dort stellt sich das Problem nicht."
#:
../../builtins/threadsafety.rst:249
msgid
""
"The following operations return new objects and hold the :term:`per-object "
"lock` for the duration of the operation:"
msgstr
""
"Die folgenden Operationen geben neue Objekte zurück und halten die :term:"
"`objektspezifische Sperre <per-object lock>` für die Dauer der Operation:"
#:
../../builtins/threadsafety.rst:252
msgid
""
"d.copy() # returns a shallow copy of the dictionary\n"
"d | other # merges two dicts into a new dict\n"
"d.keys() # returns a new dict_keys view object\n"
"d.values() # returns a new dict_values view object\n"
"d.items() # returns a new dict_items view object"
msgstr
""
"d.copy() # gibt eine flache Kopie des Dictionarys zurück\n"
"d | other # führt zwei Dictionarys zu einem neuen zusammen\n"
"d.keys() # gibt ein neues dict_keys-View-Objekt zurück\n"
"d.values() # gibt ein neues dict_values-View-Objekt zurück\n"
"d.items() # gibt ein neues dict_items-View-Objekt zurück"
#:
../../builtins/threadsafety.rst:261
msgid
""
"The :meth:`~dict.clear` method holds the lock for its duration. Other "
"threads cannot observe elements being removed."
msgstr
""
"Die Methode :meth:`~dict.clear` hält die Sperre für ihre Dauer. Andere "
"Threads können das Entfernen der Elemente nicht beobachten."
#:
../../builtins/threadsafety.rst:264
msgid
""
"The following operations lock both dictionaries. For :meth:`~dict.update` "
"and ``|=``, this applies only when the other operand is a :class:`dict` that "
"uses the standard dict iterator (but not subclasses that override "
"iteration). For equality comparison, this applies to :class:`dict` and its "
"subclasses:"
msgstr
""
"Die folgenden Operationen sperren beide Dictionarys. Für :meth:`~dict."
"update` und ``|=`` gilt das nur, wenn der andere Operand ein :class:`dict` "
"ist, das den üblichen dict-Iterator verwendet (nicht aber eine Unterklasse, "
"die das Iterieren überschreibt). Für den Gleichheitsvergleich gilt es für :"
"class:`dict` und seine Unterklassen:"
#:
../../builtins/threadsafety.rst:270
msgid
""
"d.update(other_dict) # both locked when other_dict is a dict\n"
"d |= other_dict # both locked when other_dict is a dict\n"
"d == other_dict # both locked for dict and subclasses"
msgstr
""
"d.update(other_dict) # beide gesperrt, wenn other_dict ein dict ist\n"
"d |= other_dict # beide gesperrt, wenn other_dict ein dict ist\n"
"d == other_dict # beide gesperrt bei dict und Unterklassen"
#:
../../builtins/threadsafety.rst:277
msgid
""
"All comparison operations also compare values using :meth:`~object.__eq__`, "
"so for non-built-in types the lock may be released during comparison."
msgstr
""
"Alle Vergleichsoperationen vergleichen auch die Werte über :meth:`~object."
"__eq__`. Bei nicht eingebauten Typen kann die Sperre während des Vergleichs "
"daher freigegeben werden."
#:
../../builtins/threadsafety.rst:280
msgid
""
":meth:`~dict.fromkeys` locks both the new dictionary and the iterable when "
"the iterable is exactly a :class:`dict`, :class:`set`, or :class:`frozenset` "
"(not subclasses):"
msgstr
""
":meth:`~dict.fromkeys` sperrt sowohl das neue Dictionary als auch das "
"Iterable, wenn das Iterable genau ein :class:`dict`, :class:`set` oder :"
"class:`frozenset` ist (keine Unterklasse):"
#:
../../builtins/threadsafety.rst:284
msgid
""
"dict.fromkeys(a_dict) # locks both\n"
"dict.fromkeys(a_set) # locks both\n"
"dict.fromkeys(a_frozenset) # locks both"
msgstr
""
"dict.fromkeys(a_dict) # sperrt beide\n"
"dict.fromkeys(a_set) # sperrt beide\n"
"dict.fromkeys(a_frozenset) # sperrt beide"
#:
../../builtins/threadsafety.rst:291
msgid
""
"When updating from a non-dict iterable, only the target dictionary is "
"locked. The iterable may be concurrently modified by another thread:"
msgstr
""
"Wird aus einem Iterable aktualisiert, das kein dict ist, wird nur das Ziel-"
"Dictionary gesperrt. Das Iterable kann von einem anderen Thread gleichzeitig "
"verändert werden:"
#:
../../builtins/threadsafety.rst:294
msgid
""
"d.update(iterable) # iterable is not a dict: only d locked\n"
"d |= iterable # iterable is not a dict: only d locked\n"
"dict.fromkeys(iterable) # iterable is not a dict/set/frozenset: only "
"result locked"
msgstr
""
"d.update(iterable) # iterable ist kein dict: nur d gesperrt\n"
"d |= iterable # iterable ist kein dict: nur d gesperrt\n"
"dict.fromkeys(iterable) # iterable ist kein dict/set/frozenset: nur das "
"Ergebnis gesperrt"
#:
../../builtins/threadsafety.rst:301
../../builtins/threadsafety.rst:434
#:
../../builtins/threadsafety.rst:525
msgid
""
"Operations that involve multiple accesses, as well as iteration, are never "
"atomic:"
msgstr
""
"Operationen mit mehreren Zugriffen sowie das Iterieren sind nie atomar:"
#:
../../builtins/threadsafety.rst:304
msgid
""
"# NOT atomic: read-modify-write\n"
"d[key] = d[key] + 1\n"
"\n"
"# NOT atomic: check-then-act (TOCTOU)\n"
"if key in d:\n"
" del d[key]\n"
"\n"
"# NOT thread-safe: iteration while modifying\n"
"for key, value in d.items():\n"
" process(key) # another thread may modify d"
msgstr
""
"# NICHT atomar: lesen, ändern, schreiben\n"
"d[key] = d[key] + 1\n"
"\n"
"# NICHT atomar: prüfen, dann handeln (TOCTOU)\n"
"if key in d:\n"
" del d[key]\n"
"\n"
"# NICHT threadsicher: iterieren während des Änderns\n"
"for key, value in d.items():\n"
" process(key) # ein anderer Thread kann d verändern"
#:
../../builtins/threadsafety.rst:318
msgid
""
"To avoid time-of-check to time-of-use (TOCTOU) issues, use atomic operations "
"or handle exceptions:"
msgstr
""
"Um Probleme zwischen Prüfzeitpunkt und Nutzungszeitpunkt (time-of-check to "
"time-of-use, TOCTOU) zu vermeiden, verwende atomare Operationen oder "
"behandle Ausnahmen:"
#:
../../builtins/threadsafety.rst:321
msgid
""
"# Use pop() with default instead of check-then-delete\n"
"d.pop(key, None)\n"
"\n"
"# Or handle the exception\n"
"try:\n"
" del d[key]\n"
"except KeyError:\n"
" pass"
msgstr
""
"# pop() mit Standardwert verwenden statt prüfen, dann löschen\n"
"d.pop(key, None)\n"
"\n"
"# Oder die Ausnahme behandeln\n"
"try:\n"
" del d[key]\n"
"except KeyError:\n"
" pass"
#:
../../builtins/threadsafety.rst:333
msgid
""
"To safely iterate over a dictionary that may be modified by another thread, "
"iterate over a copy:"
msgstr
""
"Um sicher über ein Dictionary zu iterieren, das von einem anderen Thread "
"verändert werden kann, iteriere über eine Kopie:"
#:
../../builtins/threadsafety.rst:336
msgid
""
"# Make a copy to iterate safely\n"
"for key, value in d.copy().items():\n"
" process(key)"
msgstr
""
"# Eine Kopie anlegen, um sicher zu iterieren\n"
"for key, value in d.copy().items():\n"
" process(key)"
#:
../../builtins/threadsafety.rst:343
msgid
""
"Consider external synchronization when sharing :class:`dict` instances "
"across threads."
msgstr
""
"Zieh äußere Synchronisierung in Erwägung, wenn du :class:`dict`-Instanzen "
"über Threads hinweg gemeinsam nutzt."
#:
../../builtins/threadsafety.rst:350
msgid
"Thread safety for set objects"
msgstr
"Threadsicherheit bei set-Objekten"
#:
../../builtins/threadsafety.rst:352
../../builtins/threadsafety.rst:457
msgid
""
"The :func:`len` function is lock-free and :term:`atomic <atomic operation>`."
msgstr
""
"Die Funktion :func:`len` ist sperrfrei und :term:`atomar <atomic operation>`."
#:
../../builtins/threadsafety.rst:354
msgid
""
"The following read operation is lock-free. It does not block concurrent "
"modifications and may observe intermediate states from operations that hold "
"the per-object lock:"
msgstr
""
"Die folgende Leseoperation ist sperrfrei. Sie blockiert gleichzeitige "
"Änderungen nicht und kann Zwischenzustände von Operationen beobachten, die "
"die objektspezifische Sperre halten:"
#:
../../builtins/threadsafety.rst:358
msgid
"elem in s # set.__contains__"
msgstr
"elem in s # set.__contains__"
#:
../../builtins/threadsafety.rst:363
msgid
""
"This operation may compare elements using :meth:`~object.__eq__`, which can "
"execute arbitrary Python code. During such comparisons, the set may be "
"modified by another thread. For built-in types like :class:`str`, :class:"
"`int`, and :class:`float`, :meth:`!__eq__` does not release the underlying "
"lock during comparisons and this is not a concern."
msgstr
""
"Diese Operation kann Elemente über :meth:`~object.__eq__` vergleichen, was "
"beliebigen Python-Code ausführen kann. Während solcher Vergleiche kann die "
"Menge von einem anderen Thread verändert werden. Bei eingebauten Typen wie :"
"class:`str`, :class:`int` und :class:`float` gibt :meth:`!__eq__` die "
"zugrunde liegende Sperre während der Vergleiche nicht frei. Dort stellt sich "
"das Problem nicht."
#:
../../builtins/threadsafety.rst:369
../../builtins/threadsafety.rst:470
msgid
"All other operations from here on hold the per-object lock."
msgstr
""
"Alle weiteren Operationen von hier an halten die objektspezifische Sperre."
#:
../../builtins/threadsafety.rst:371
msgid
""
"Adding or removing a single element is safe to call from multiple threads "
"and will not corrupt the set:"
msgstr
""
"Ein einzelnes Element hinzuzufügen oder zu entfernen lässt sich sicher aus "
"mehreren Threads aufrufen und beschädigt die Menge nicht:"
#:
../../builtins/threadsafety.rst:374
msgid
""
"s.add(elem) # add element\n"
"s.remove(elem) # remove element, raise if missing\n"
"s.discard(elem) # remove element if present\n"
"s.pop() # remove and return arbitrary element"
msgstr
""
"s.add(elem) # Element hinzufügen\n"
"s.remove(elem) # Element entfernen, Ausnahme auslösen, falls nicht "
"vorhanden\n"
"s.discard(elem) # Element entfernen, falls vorhanden\n"
"s.pop() # ein beliebiges Element entfernen und zurückgeben"
#:
../../builtins/threadsafety.rst:382
msgid
""
"These operations also compare elements, so the same :meth:`~object.__eq__` "
"considerations as above apply."
msgstr
""
"Diese Operationen vergleichen ebenfalls Elemente, es gelten also dieselben "
"Überlegungen zu :meth:`~object.__eq__` wie oben."
#:
../../builtins/threadsafety.rst:385
msgid
""
"The :meth:`~set.copy` method returns a new object and holds the per-object "
"lock for the duration so that it is always atomic."
msgstr
""
"Die Methode :meth:`~set.copy` gibt ein neues Objekt zurück und hält die "
"objektspezifische Sperre für ihre Dauer, sodass sie immer atomar ist."
#:
../../builtins/threadsafety.rst:388
msgid
""
"The :meth:`~set.clear` method holds the lock for its duration. Other threads "
"cannot observe elements being removed."
msgstr
""
"Die Methode :meth:`~set.clear` hält die Sperre für ihre Dauer. Andere "
"Threads können das Entfernen der Elemente nicht beobachten."
#:
../../builtins/threadsafety.rst:391
msgid
""
"The following operations only accept :class:`set` or :class:`frozenset` as "
"operands and always lock both objects:"
msgstr
""
"Die folgenden Operationen nehmen nur :class:`set` oder :class:`frozenset` "
"als Operanden und sperren immer beide Objekte:"
#:
../../builtins/threadsafety.rst:394
msgid
""
"s |= other # other must be set/frozenset\n"
"s &= other # other must be set/frozenset\n"
"s -= other # other must be set/frozenset\n"
"s ^= other # other must be set/frozenset\n"
"s & other # other must be set/frozenset\n"
"s | other # other must be set/frozenset\n"
"s - other # other must be set/frozenset\n"
"s ^ other # other must be set/frozenset"
msgstr
""
"s |= other # other muss ein set/frozenset sein\n"
"s &= other # other muss ein set/frozenset sein\n"
"s -= other # other muss ein set/frozenset sein\n"
"s ^= other # other muss ein set/frozenset sein\n"
"s & other # other muss ein set/frozenset sein\n"
"s | other # other muss ein set/frozenset sein\n"
"s - other # other muss ein set/frozenset sein\n"
"s ^ other # other muss ein set/frozenset sein"
#:
../../builtins/threadsafety.rst:406
msgid
""
":meth:`set.update`, :meth:`set.union`, :meth:`set.intersection` and :meth:"
"`set.difference` can take multiple iterables as arguments. They all iterate "
"through all the passed iterables and do the following:"
msgstr
""
":meth:`set.update`, :meth:`set.union`, :meth:`set.intersection` und :meth:"
"`set.difference` können mehrere Iterables als Argumente nehmen. Sie "
"durchlaufen alle übergebenen Iterables und tun Folgendes:"
#:
../../builtins/threadsafety.rst:410
#,
fuzzy
msgid
""
":meth:`set.update` and :meth:`set.union` lock both objects only when the "
"other operand is a :class:`set`, :class:`frozenset`, or :class:`dict`."
msgstr
""
"der andere Operand ein :class:`set`, :class:`frozenset` oder :class:`dict` "
"ist."
#:
../../builtins/threadsafety.rst:412
#,
fuzzy
msgid
""
":meth:`set.intersection` and :meth:`set.difference` always try to lock all "
"objects."
msgstr
":meth:`set.intersection` und :meth:`set.difference` versuchen immer,"
#:
../../builtins/threadsafety.rst:415
msgid
":meth:`set.symmetric_difference` tries to lock both objects."
msgstr
":meth:`set.symmetric_difference` versucht, beide Objekte zu sperren."
#:
../../builtins/threadsafety.rst:417
msgid
""
"The update variants of the above methods also have some differences between "
"them:"
msgstr
""
"Die aktualisierenden Varianten der obigen Methoden unterscheiden sich "
"untereinander ebenfalls in einigen Punkten:"
#:
../../builtins/threadsafety.rst:420
#,
fuzzy
msgid
""
":meth:`set.difference_update` and :meth:`set.intersection_update` try to "
"lock all objects one-by-one."
msgstr
""
":meth:`set.difference_update` und :meth:`set.intersection_update` versuchen,"
#:
../../builtins/threadsafety.rst:422
#,
fuzzy
msgid
""
":meth:`set.symmetric_difference_update` only locks the arguments if it is of "
"type :class:`set`, :class:`frozenset`, or :class:`dict`."
msgstr
""
":meth:`set.symmetric_difference_update` sperrt die Argumente nur, wenn sie"
#:
../../builtins/threadsafety.rst:425
msgid
"The following methods always try to lock both objects:"
msgstr
"Die folgenden Methoden versuchen immer, beide Objekte zu sperren:"
#:
../../builtins/threadsafety.rst:427
msgid
""
"s.isdisjoint(other) # both locked\n"
"s.issubset(other) # both locked\n"
"s.issuperset(other) # both locked"
msgstr
""
"s.isdisjoint(other) # beide gesperrt\n"
"s.issubset(other) # beide gesperrt\n"
"s.issuperset(other) # beide gesperrt"
#:
../../builtins/threadsafety.rst:437
msgid
""
"# NOT atomic: check-then-act\n"
"if elem in s:\n"
" s.remove(elem)\n"
"\n"
"# NOT thread-safe: iteration while modifying\n"
"for elem in s:\n"
" process(elem) # another thread may modify s"
msgstr
""
"# NICHT atomar: prüfen, dann handeln\n"
"if elem in s:\n"
" s.remove(elem)\n"
"\n"
"# NICHT threadsicher: iterieren während des Änderns\n"
"for elem in s:\n"
" process(elem) # ein anderer Thread kann s verändern"
#:
../../builtins/threadsafety.rst:448
msgid
""
"Consider external synchronization when sharing :class:`set` instances across "
"threads. See :ref:`freethreading-python-howto` for more information."
msgstr
""
"Zieh äußere Synchronisierung in Erwägung, wenn du :class:`set`-Instanzen "
"über Threads hinweg gemeinsam nutzt. Mehr dazu unter :ref:`freethreading-"
"python-howto`."
#:
../../builtins/threadsafety.rst:455
msgid
"Thread safety for bytearray objects"
msgstr
"Threadsicherheit bei bytearray-Objekten"
#:
../../builtins/threadsafety.rst:459
msgid
""
"Concatenation and comparisons use the buffer protocol, which prevents "
"resizing but does not hold the per-object lock. These operations may observe "
"intermediate states from concurrent modifications:"
msgstr
""
"Verkettung und Vergleiche verwenden das Puffer-Protokoll, das eine "
"Größenänderung verhindert, aber die objektspezifische Sperre nicht hält. "
"Diese Operationen können Zwischenzustände gleichzeitiger Änderungen "
"beobachten:"
#:
../../builtins/threadsafety.rst:463
msgid
""
"ba + other # may observe concurrent writes\n"
"ba == other # may observe concurrent writes\n"
"ba < other # may observe concurrent writes"
msgstr
""
"ba + other # kann gleichzeitige Schreibzugriffe beobachten\n"
"ba == other # kann gleichzeitige Schreibzugriffe beobachten\n"
"ba < other # kann gleichzeitige Schreibzugriffe beobachten"
#:
../../builtins/threadsafety.rst:472
msgid
""
"Reading a single element or slice is safe to call from multiple threads:"
msgstr
""
"Ein einzelnes Element oder ein Slice zu lesen lässt sich sicher aus mehreren "
"Threads aufrufen:"
#:
../../builtins/threadsafety.rst:474
msgid
""
"ba[i] # bytearray.__getitem__\n"
"ba[i:j] # slice"
msgstr
""
"ba[i] # bytearray.__getitem__\n"
"ba[i:j] # slice"
#:
../../builtins/threadsafety.rst:480
msgid
""
"The following operations are safe to call from multiple threads and will not "
"corrupt the bytearray:"
msgstr
""
"Die folgenden Operationen lassen sich sicher aus mehreren Threads aufrufen "
"und beschädigen das bytearray nicht:"
#:
../../builtins/threadsafety.rst:483
msgid
""
"ba[i] = x # write single byte\n"
"ba[i:j] = values # write slice\n"
"ba.append(x) # append single byte\n"
"ba.extend(other) # extend with iterable\n"
"ba.insert(i, x) # insert single byte\n"
"ba.pop() # remove and return last byte\n"
"ba.pop(i) # remove and return byte at index\n"
"ba.remove(x) # remove first occurrence\n"
"ba.reverse() # reverse in place\n"
"ba.clear() # remove all bytes"
msgstr
""
"ba[i] = x # einzelnes Byte schreiben\n"
"ba[i:j] = values # Slice schreiben\n"
"ba.append(x) # einzelnes Byte anhängen\n"
"ba.extend(other) # mit einem Iterable erweitern\n"
"ba.insert(i, x) # einzelnes Byte einfügen\n"
"ba.pop() # letztes Byte entfernen und zurückgeben\n"
"ba.pop(i) # Byte am Index entfernen und zurückgeben\n"
"ba.remove(x) # erstes Vorkommen entfernen\n"
"ba.reverse() # an Ort und Stelle umkehren\n"
"ba.clear() # alle Bytes entfernen"
#:
../../builtins/threadsafety.rst:497
msgid
""
"Slice assignment locks both objects when *values* is a :class:`bytearray`:"
msgstr
""
"Die Zuweisung an ein Slice sperrt beide Objekte, wenn *values* ein :class:"
"`bytearray` ist:"
#:
../../builtins/threadsafety.rst:499
msgid
"ba[i:j] = other_bytearray # both locked"
msgstr
"ba[i:j] = other_bytearray # beide gesperrt"
#:
../../builtins/threadsafety.rst:504
msgid
""
"The following operations return new objects and hold the per-object lock for "
"the duration:"
msgstr
""
"Die folgenden Operationen geben neue Objekte zurück und halten die "
"objektspezifische Sperre für ihre Dauer:"
#:
../../builtins/threadsafety.rst:507
msgid
""
"ba.copy() # returns a shallow copy\n"
"ba * n # repeat into new bytearray"
msgstr
""
"ba.copy() # gibt eine flache Kopie zurück\n"
"ba * n # in ein neues bytearray wiederholen"
#:
../../builtins/threadsafety.rst:513
View remainder of file in raw view
Back
|
FazBrowse Home
|
New Git URL