摘要:
资源竞争解决方法 1:加锁,解锁 mutex =threading.Lock() mutex.acquire()#加锁 mutex.release()#解锁 2:容易死锁 需要添加等待时间或者使用算法解决 阅读全文
摘要:
import threading def test(): #def test(temp): for i in range(4): print(i) def test1(): for i in range(4): print(i) a=10 def main(): t1=threading.Threa 阅读全文
摘要:
names=["aa","bb","cc"] for i in names: print(i) =>>aa =>>bb =>>cc for i in enmuerate(names): print(1) =>>(0,'aa') =>>(1,'bb') =>>(2,'cc') #增加拆包时 for i 阅读全文