![](https://img-blog.csdnimg.cn/20201014180756913.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
多线程
nio006
这个作者很懒,什么都没留下…
展开
-
多线程问题2
1.死锁问题 import threading lock_1=threading.Lock() lock_2=threading.Lock() def func1(): lock_1.acquire() time.sleep(2) lock_2.acquire() lock_2.release() lock_1.release() def func2(): lock_2.acquire...原创 2018-12-19 20:50:12 · 98 阅读 · 0 评论 -
python 多线程
# 线程安全变量:queue # 线程不安全变量:list,set,dict # 生产者消费者问题 # 死锁问题:多个线程竞争资源而造成的一种僵局 import threading import time lock_1 = threading.Lock() lock_2 = threading.Lock() def func_1(): lock_1.acquire() time...原创 2019-08-05 22:00:40 · 88 阅读 · 0 评论