Todo: 集成多平台 解决因SaiNiu线程抢占资源问题 本地提交测试环境打包 和 正式打包脚本与正式环境打包bat 提交Python32环境包 改进多日志文件生成情况修改打包日志细节
This commit is contained in:
18
Utils/PythonNew32/Lib/test/mp_fork_bomb.py
Normal file
18
Utils/PythonNew32/Lib/test/mp_fork_bomb.py
Normal file
@@ -0,0 +1,18 @@
|
||||
import multiprocessing, sys
|
||||
|
||||
def foo():
|
||||
print("123")
|
||||
|
||||
# Because "if __name__ == '__main__'" is missing this will not work
|
||||
# correctly on Windows. However, we should get a RuntimeError rather
|
||||
# than the Windows equivalent of a fork bomb.
|
||||
|
||||
if len(sys.argv) > 1:
|
||||
multiprocessing.set_start_method(sys.argv[1])
|
||||
else:
|
||||
multiprocessing.set_start_method('spawn')
|
||||
|
||||
p = multiprocessing.Process(target=foo)
|
||||
p.start()
|
||||
p.join()
|
||||
sys.exit(p.exitcode)
|
||||
Reference in New Issue
Block a user