[Python-Dev] Re: Hang with parallel make

2020年2月26日 10:17:28 -0800

A simple example that reproduces the hang (please keep in mind that I have very 
little experience writing Python code...):
 import os
 from concurrent.futures import ThreadPoolExecutor
 
 def new_process(arg):
 pid = os.fork()
 if pid == 0:
 exec_fn("/bin/true", "/bin/true")
 else:
 pid, status = os.waitpid(pid, 0)
 
 with ThreadPoolExecutor(max_workers=4) as executor:
 futures = [executor.submit(new_process, None)
 for i in range(0, 4)]
 for fut in futures:
 fut.result()
--Elad
_______________________________________________
Python-Dev mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-dev.python.org/
Message archived at 
https://mail.python.org/archives/list/[email protected]/message/ZOJNVZJIRJJF6RTEWFJ4HG2KZXYY6CLV/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to