[issue16998] Lost updates with multiprocessing.Value
Richard Oudkerk
report at bugs.python.org
Sun Jan 20 11:57:28 CET 2013
Richard Oudkerk added the comment:
> I see. Then this is a documentation bug. The examples in the
> documentation use such non-thread-safe assignments (combined with the
> statement "These shared objects will be process and thread safe.").
Are you talking about this documentation:
If lock is True (the default) then a new lock object is created to
synchronize access to the value. If lock is a Lock or RLock object then
that will be used to synchronize access to the value. If lock is False
then access to the returned object will not be automatically protected
by a lock, so it will not necessarily be “process-safe”.
It only says that accesses are synchronized. The problem is that you were assuming that "+=" involves a single access -- but that is not how python works.
Where in the examples is there "non-process-safe" access? (Note that waiting for the only process which modifies a value to terminate using join() will prevent races.)
----------
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue16998>
_______________________________________
More information about the Python-bugs-list
mailing list