[Python-checkins] r74326 - in python/trunk: Doc/library/multiprocessing.rst Lib/multiprocessing/queues.py Misc/ACKS Misc/NEWS
jesse.noller
python-checkins at python.org
Thu Aug 6 04:05:57 CEST 2009
Author: jesse.noller
Date: Thu Aug 6 04:05:56 2009
New Revision: 74326
Log:
Fix issue 4660: spurious task_done errors in multiprocessing, remove doc note for from_address
Modified:
python/trunk/Doc/library/multiprocessing.rst
python/trunk/Lib/multiprocessing/queues.py
python/trunk/Misc/ACKS
python/trunk/Misc/NEWS
Modified: python/trunk/Doc/library/multiprocessing.rst
==============================================================================
--- python/trunk/Doc/library/multiprocessing.rst (original)
+++ python/trunk/Doc/library/multiprocessing.rst Thu Aug 6 04:05:56 2009
@@ -1153,11 +1153,6 @@
Run the server in the current process.
- .. method:: from_address(address, authkey)
-
- A class method which creates a manager object referring to a pre-existing
- server process which is using the given address and authentication key.
-
.. method:: get_server()
Returns a :class:`Server` object which represents the actual server under
Modified: python/trunk/Lib/multiprocessing/queues.py
==============================================================================
--- python/trunk/Lib/multiprocessing/queues.py (original)
+++ python/trunk/Lib/multiprocessing/queues.py Thu Aug 6 04:05:56 2009
@@ -282,9 +282,22 @@
Queue.__setstate__(self, state[:-2])
self._cond, self._unfinished_tasks = state[-2:]
- def put(self, item, block=True, timeout=None):
- Queue.put(self, item, block, timeout)
- self._unfinished_tasks.release()
+ def put(self, obj, block=True, timeout=None):
+ assert not self._closed
+ if not self._sem.acquire(block, timeout):
+ raise Full
+
+ self._notempty.acquire()
+ self._cond.acquire()
+ try:
+ if self._thread is None:
+ self._start_thread()
+ self._buffer.append(obj)
+ self._unfinished_tasks.release()
+ self._notempty.notify()
+ finally:
+ self._cond.release()
+ self._notempty.release()
def task_done(self):
self._cond.acquire()
Modified: python/trunk/Misc/ACKS
==============================================================================
--- python/trunk/Misc/ACKS (original)
+++ python/trunk/Misc/ACKS Thu Aug 6 04:05:56 2009
@@ -485,6 +485,7 @@
Lambert Meertens
Bill van Melle
Lucas Prado Melo
+Brian Merrell
Luke Mewburn
Mike Meyer
Steven Miale
Modified: python/trunk/Misc/NEWS
==============================================================================
--- python/trunk/Misc/NEWS (original)
+++ python/trunk/Misc/NEWS Thu Aug 6 04:05:56 2009
@@ -354,6 +354,9 @@
Library
-------
+- Issue #4660: If a multiprocessing.JoinableQueue.put() was preempted, it was
+ possible to get a spurious 'task_done() called too many times' error.
+
- Issue #6595: The Decimal constructor now allows arbitrary Unicode
decimal digits in input, as recommended by the standard. Previously
it was restricted to accepting [0-9].
More information about the Python-checkins
mailing list