Roundup Robot added the comment:
New changeset 7aabbe919f55 by Richard Oudkerk in branch '2.7':
Issue 16998: Clarify that += on a shared value is not atomic.
http://hg.python.org/cpython/rev/7aabbe919f55
New changeset 11cafbe6519f by Richard Oudkerk in branch '3.3':
Issue 16998: Clarify that +=
Changes by Richard Oudkerk shibt...@gmail.com:
--
resolution: - fixed
stage: - committed/rejected
status: open - closed
type: behavior -
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16998
Jens Lechtenboerger added the comment:
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.
Yes, I understand that by now (actually since your first comment).
Where in the examples is
Jens Lechtenboerger added the comment:
Loads and stores are both atomic. But += is made up of two operations, a
load followed by a store, and the lock is dropped between the two.
I see. Then this is a documentation bug. The examples in the documentation
use such non-thread-safe
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
New submission from Jens Lechtenboerger:
Maybe I'm misreading the documentation of multiprocessing.Value and
multiprocessing.sharedctypes.Value.
I thought that access to the value field of Value instances was protected by
locks to avoid lost updates.
Specifically, for
Changes by Antoine Pitrou pit...@free.fr:
--
nosy: +sbt
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16998
___
___
Python-bugs-list mailing list
Richard Oudkerk added the comment:
I thought that access to the value field of Value instances was
protected by locks to avoid lost updates.
Loads and stores are both atomic. But += is made up of two operations, a
load followed by a store, and the lock is dropped between the two.
The same