[issue10432] concurrent.futures.as_completed() spins waiting for futures to complete
report at bugs.python.org
Tue Nov 16 11:59:36 CET 2010
New submission from Scott Dial <scott at scottdial.com>:
The code in as_completed() waits on a FIRST_COMPLETED event, which means that after the first future completes, it will no longer wait at all. The proposed patch adds a _AsCompletedWaiter and uses a lock to swap out the finished list and reset the event.
This is a difficult problem to create a test case for without adding intrusive code to as_completed() to count how many times it loops or create a mock Event object that counts it, so I have not proposed a test.
components: Library (Lib)
title: concurrent.futures.as_completed() spins waiting for futures to complete
versions: Python 3.2, Python 3.3
Added file: http://bugs.python.org/file19615/futures-r86476.patch
Python tracker <report at bugs.python.org>
More information about the Python-bugs-list