fiete added the comment:
Since the only thing I know about the multiprocessing internals is what I just
read in the source code trying to debug my imap_unordered call, I'll add the
following example, not knowing whether this is already covered by everything
you have until now.
import multiprocessing.pool
def gen():
raise Exception('generator exception')
yield 1
yield 2
for i in range(3):
with multiprocessing.pool.ThreadPool(3) as pool:
try:
print(list(pool.imap_unordered(lambda x: x*2, gen())))
except Exception as e:
print(e)
This only prints 'generator exception' once for the first iteration. For the
following iterations imap_unordered returns an empty list. This is the case for
both Pool and ThreadPool.
----------
nosy: +fiete
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue28699>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com