摘要: # #from multiprocessing import Process # from threading import Thread # import time # def task(name): # print('%s is running'%name) # time.sleep(3) # if __name__ == '__main__': # t=Threa... 阅读全文
posted @ 2018-04-26 23:30 嘿, 阅读(130) 评论(0) 推荐(0) 编辑
摘要: import json import time import random import os from multiprocessing import Process,Lock mutex=Lock() # 互斥锁vs join的区别一: # 互斥锁可以让一部分代码(修改共享数据的代码)串行,而join只能将代码整体串行 def search(): time.sleep(ra... 阅读全文
posted @ 2018-04-26 00:01 嘿, 阅读(144) 评论(0) 推荐(0) 编辑