摘要:
1 import queue 2 q = queue.Queue() #模拟队列,先进先出 3 q.put('first') 4 q.put('second') 5 q.put('third') 6 7 print(q.get()) 8 print(q.get()) 9 print(q.get()) 阅读全文
摘要:
这个模块是我遇到的最简单的了。。。。。。。。。。。 阅读全文
摘要:
from threading import Thread,Event,currentThread import time e = Event() def conn_mysql(): count = 1 while e.is_set(): #没收到信号执行 if count>3: #超过三次,弹出错误 raise Connectio... 阅读全文
摘要:
死锁↑ 递归锁↓ 阅读全文
摘要:
1 from multiprocessing import Process 2 from threading import Thread 3 import threading 4 import os,time 5 def work(): 6 time.sleep(2) 7 print(' >') 8 阅读全文