New submission from Lorenzo Persichetti :
According to the documentation of the multiprocessing.Value() class available here https://docs.python.org/3.6/library/multiprocessing.html#multiprocessing.Val...
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
What happens is that when running the following snippet
import multiprocessing
manager = multiprocessing.Manager()
value = manager.Value('i', 0)
value.get_lock()
the result is
AttributeError: 'ValueProxy' object has no attribute 'get_lock'
----------
assignee: docs@python
components: Documentation, Library (Lib), Windows
messages: 334070
nosy: Lorenzo Persichetti, docs@python, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: get_lock() method is not present for Values created using multiprocessing.Manager()
versions: Python 3.6
_______________________________________
Python tracker
https://bugs.python.org/issue35786
_______________________________________