Davin Potts <pyt...@discontinuity.net> added the comment:

Barry's effort as well as comments in other links seem to all suggest that 
OBJC_DISABLE_INITIALIZE_FORK_SAFETY is not comprehensive in its ability to make 
other threads "safe" before forking.

"Objective-C classes defined by the OS frameworks remain fork-unsafe" (from 
@kapilt's first link) suggests we furthermore remain at risk using certain 
MacOS system libraries prior to any call to fork.

"To guarantee that forking is safe, the application must not be running any 
threads at the point of fork" (from @kapilt's second link) is an old truth that 
we continue to fight with even when we know very well that it's the truth.

For newly developed code, we have the alternative to employ spawn instead of 
fork to avoid these problems in Python, C, Ruby, etc.  For existing legacy code 
that employed fork and now surprises us by failing-fast on MacOS 10.13 and 
10.14, it seems we are forced to face a technical debt incurred back when the 
choice was first made to spin up threads and afterwards to use fork.

If we didn't already have an "obvious" (zen of Python) way to avoid such 
problems with spawn versus fork, I would feel this was something to solve in 
Python.  As to helping the poor unfortunate souls who must fight the good fight 
with legacy code, I am not sure what to do to help though I would like to be 
able to help.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue33725>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to