Python-多进程 Fork 异常

Python 解决多进程 Fork 异常。

问题:

1
2
objc[2483]: +[__NSPlaceholderDate initialize] may have been in progress in another thread when fork() was called.
objc[2483]: +[__NSPlaceholderDate initialize] may have been in progress in another thread when fork() was called. We cannot safely call it or ignore it in the fork() child process. Crashing instead. Set a breakpoint on objc_initializeAfterForkError to debug.

解决:

1
2
3
vim ~/.bash_profile 
OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES
source ~/.bash_profile