摘要:
import threading,time class Boss(threading.Thread): def run(self): print("We must work today!") event.isSet() or event.set() time.sleep(5) print("You 阅读全文
posted @ 2019-12-15 12:31
Iceberg_710815
阅读(297)
评论(0)
推荐(0)
摘要:
python中的信号量,是通过定义semaphore对象,控制同时可以运行的线程的数量,同时也是一种锁,下面的代码演示了信号量的应用 import threading,time class MyThread(threading.Thread): def __init__(self,name): th 阅读全文
posted @ 2019-12-15 11:05
Iceberg_710815
阅读(209)
评论(0)
推荐(0)
浙公网安备 33010602011771号