[issue35378] multiprocessing.Pool.imaps iterators do not maintain alive the multiprocessing.Pool objects

Pablo Galindo Salgado report at bugs.python.org
Sun Jan 13 17:04:00 EST 2019


Pablo Galindo Salgado <pablogsal at gmail.com> added the comment:

I have been playing with possible solutions for a while and the weak-reference solution seems not robust enough as there are too potential race conditions between the destruction of the weakreferences (the pool) and the handling code.

I would advocate again for using a strong reference. The reasons are:

* The rest of the stdlib is using this solution to link iterator objects and similar to their parents (lists, dicts, sets...etc all have strong references back to their parents).

* This solution is backwards compatible with the current behaviour.

* We have the new ResourceWarnigns to make clear that this behaviour is not supported.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue35378>
_______________________________________


More information about the Python-bugs-list mailing list