Starting new threads and process creation through os.fork
during interpreter shutdown (such as from atexit
handlers) is no longer supported. It can lead to race condition between the main Python runtime thread freeing thread states while internal threading
routines are trying to allocate and use the state of just created threads. Or forked children trying to use the mid-shutdown runtime and thread state in the child process.