[issue16998] Lost updates with multiprocessing.Value

2013-11-17 Thread Roundup Robot
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 +=

[issue16998] Lost updates with multiprocessing.Value

2013-11-17 Thread Richard Oudkerk
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

[issue16998] Lost updates with multiprocessing.Value

2013-01-21 Thread Jens Lechtenboerger
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

[issue16998] Lost updates with multiprocessing.Value

2013-01-20 Thread Jens Lechtenboerger
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

[issue16998] Lost updates with multiprocessing.Value

2013-01-20 Thread Richard Oudkerk
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

[issue16998] Lost updates with multiprocessing.Value

2013-01-19 Thread Jens Lechtenboerger
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

[issue16998] Lost updates with multiprocessing.Value

2013-01-19 Thread Antoine Pitrou
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

[issue16998] Lost updates with multiprocessing.Value

2013-01-19 Thread Richard Oudkerk
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