[New-bugs-announce] [issue10432] concurrent.futures.as_completed() spins waiting for futures to complete

Scott Dial 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)
files: futures-r86476.patch
keywords: patch
messages: 121280
nosy: scott.dial
priority: normal
severity: normal
status: open
title: concurrent.futures.as_completed() spins waiting for futures to complete
type: behavior
versions: Python 3.2, Python 3.3
Added file: http://bugs.python.org/file19615/futures-r86476.patch

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue10432>
_______________________________________


More information about the New-bugs-announce mailing list