【发布时间】:2020-05-08 12:57:15
【问题描述】:
Python 多处理中Process.terminate() 和Process.kill() 有什么区别?
【问题讨论】:
-
您阅读文档了吗?你不清楚哪一部分?
标签: python python-3.x python-multiprocessing
Python 多处理中Process.terminate() 和Process.kill() 有什么区别?
【问题讨论】:
标签: python python-3.x python-multiprocessing
terminate() 向进程发送SIGTERM 信号
terminate():
Terminate the process. On Unix this is done using the SIGTERM signal; on Windows TerminateProcess() is used. Note that exit handlers and finally clauses, etc., will not be executed.
kill() 向进程发送SIGKILL 信号。
kill():
Same as terminate() but using the SIGKILL signal on Unix.
进程如何处理这些信号取决于它。通常,SIGTERM 是正常关闭,而SIGKILL 更像是中止。 More details
【讨论】: