[issue40860] Exception in multiprocessing/context.py under load

Irit Katriel report at bugs.python.org
Sun Aug 9 19:08:48 EDT 2020


Irit Katriel <iritkatriel at yahoo.com> added the comment:

The source code for the Process class is here: https://github.com/python/cpython/blob/master/Lib/multiprocessing/process.py

You can see that join and start both modify the global, non thread safe _children set. I'm guessing this is where you're seeing interference between threads.

I'm not sure a lock on start is enough - I think you need to get the lock for the join_process(job, deadline) call as well, because join can modify _children too. (Or, alternatively, manage all processes from a single thread.)

----------
nosy: +iritkatriel

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


More information about the Python-bugs-list mailing list