摘要: from multiprocessing import Process, Pool import time def select(): time.sleep(1) print(time.ctime()) return '这是每个进行执行完后返回的值,该值会会被 callback函数接收' def f 阅读全文
posted @ 2021-01-11 23:49 leungqingyun 阅读(128) 评论(0) 推荐(0) 编辑
摘要: 1. 多进程队列 , 只能实现数据交互,不能共享 from multiprocessing import Process,Queue import time import uuid class MyProcess(Process): def __init__(self,q): super(MyPro 阅读全文
posted @ 2021-01-11 20:26 leungqingyun 阅读(122) 评论(0) 推荐(0) 编辑
摘要: 1. 进程的创建方式1 from multiprocessing import Process import time def func(thread_name): print(thread_name) time.sleep(2) if __name__ == '__main__': p = Pro 阅读全文
posted @ 2021-01-11 18:56 leungqingyun 阅读(57) 评论(0) 推荐(0) 编辑