标签:child list style bsp 数据 name tip ESS sleep
# 每个进程之间的数据是独立的 import multiprocessing, time # 进程 cpu密集型任务 ,多线程 io 密集型任务 def conversation(qq): print(‘开始聊天了,%s在聊‘ % qq) time.sleep(1) if __name__ == ‘__main__‘: for i in range(10): p = multiprocessing.Process(target=conversation, args=(‘董秀丽‘,)) p.start() while len(multiprocessing.active_children())!=0: # 等待子进程,返回的是list,所以用len pass print(‘结束了。。。‘)
标签:child list style bsp 数据 name tip ESS sleep
原文地址:https://www.cnblogs.com/skyxiuli/p/10959349.html