摘要:
from threading import Thread,Lockimport timea=10b=10lock=Lock()def fun(): # lock.acquire() global a global b a+=1 time.sleep(1) b+=1 # lock.release() 阅读全文
摘要:
#进程间通信,队列 from multiprocessing import Process,Queue import os,sys import time q=Queue() def get(data): time.sleep(2) print("thread {} get {}".format(o 阅读全文