假设限制50
1.只有一个主进程的程序如果超了会被kill
2.主进程中的子进程超了,超出的子进程会被kill,不会影响其它进程和主进程
#!/usr/bin/env python
import sys
from multiprocessing import Process
import multiprocessing
import time
def predict_process(i):
print(str(i)+'start')
x = bytes('test', 'utf-8').zfill(1000 * 1000 * 40)
while True:
print(i)
time.sleep(2)
# print(str(i)+'end')
def predict():
ps=[]
for i in range(4):
p = Process(target=predict_process,
args=(i,))
p.start()
ps.append(p)
for w in ps:
w.join()
print(w)
if __name__ == '__main__':
import os
predict()
# app.run(debug=False, threaded=True, host=get_host_ip(), port=9010)