Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
edcf8daa
Kaydet (Commit)
edcf8daa
authored
Kas 17, 2013
tarafından
Richard Oudkerk
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Issue 16998: Clarify that += on a shared value is not atomic.
üst
9eefe91f
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
6 deletions
+18
-6
multiprocessing.rst
Doc/library/multiprocessing.rst
+18
-6
No files found.
Doc/library/multiprocessing.rst
Dosyayı görüntüle @
edcf8daa
...
@@ -1006,12 +1006,24 @@ inherited by child processes.
...
@@ -1006,12 +1006,24 @@ inherited by child processes.
ctypes type or a one character typecode of the kind used by the :mod:`array`
ctypes type or a one character typecode of the kind used by the :mod:`array`
module. *\*args* is passed on to the constructor for the type.
module. *\*args* is passed on to the constructor for the type.
If *lock* is ``True`` (the default) then a new lock object is created to
If *lock* is ``True`` (the default) then a new recursive lock
synchronize access to the value. If *lock* is a :class:`Lock` or
object is created to synchronize access to the value. If *lock* is
:class:`RLock` object then that will be used to synchronize access to the
a :class:`Lock` or :class:`RLock` object then that will be used to
value. If *lock* is ``False`` then access to the returned object will not be
synchronize access to the value. If *lock* is ``False`` then
automatically protected by a lock, so it will not necessarily be
access to the returned object will not be automatically protected
"process-safe".
by a lock, so it will not necessarily be "process-safe".
Operations like ``+=`` which involve a read and write are not
atomic. So if, for instance, you want to atomically increment a
shared value it is insufficient to just do ::
counter.value += 1
Assuming the associated lock is recursive (which it is by default)
you can instead do ::
with counter.get_lock():
counter.value += 1
Note that *lock* is a keyword-only argument.
Note that *lock* is a keyword-only argument.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment