> I think this is indeed useful, but I'm tempted to go further and say we
> should make this the default - and only - behavior. This will probably
> break existing code that accidentaly relied the fact that the
> implementation uses a bare fork(), but i'd say it's worth it:
I'm not convinced about making it the default behaviour, and certainly not the only one.
I have a working patch which ensures that leaked semaphores get cleaned up on exit. However, I think to add proper tests for the patch, test_multiprocessing needs to be refactored. Maybe we could end up with
multiprocessing_common.py
test_multiprocessing_processes_fork.py
test_multiprocessing_processes_nofork.py
test_multiprocessing_manager_fork.py
test_multiprocessing_manager_nofork.py
test_multiprocessing_threads.py
test_multiprocessing_others.py
The actual unittests would be in multiprocessing_common.py and test_multiprocessing_others.py. The other files would run the unittests in multiprocessing_common.py using different configurations.
Thoughts? |