[New-bugs-announce] [issue34367] AsyncResult.get() only notifies one thread
report at bugs.python.org
Thu Aug 9 10:17:49 EDT 2018
New submission from Alexander Tsvetkov <xflower at gmail.com>:
If more than one thread is waiting for the multiprocessing.pool.AsyncResult (aka ApplyResult) returned from apply_async, only one thread will be notified once the result arrives.
It happens because AsyncResult._set calls notify upon the result arrival, not notify_all.
threading.Event used in Python 3 uses notify_all.
Reproduction script is attached.
is printed to STDOUT.
The script hangs.
components: Library (Lib)
title: AsyncResult.get() only notifies one thread
versions: Python 2.7
Added file: https://bugs.python.org/file47736/async_result_demo.py
Python tracker <report at bugs.python.org>
More information about the New-bugs-announce