New submission from Alexander Tsvetkov <xflo...@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.
Expected outcome:
1
1
is printed to STDOUT.

Observed outcome:
The script hangs.

----------
components: Library (Lib)
files: async_result_demo.py
messages: 323323
nosy: AlexWithBeard
priority: normal
severity: normal
status: open
title: AsyncResult.get() only notifies one thread
versions: Python 2.7
Added file: https://bugs.python.org/file47736/async_result_demo.py

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue34367>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to