一、锁在多线程中的使用:线程互斥 lock = threading.Lock()#创建一个锁对象 1、with lock: pass 和进程使用的方式相同 2、控制线程结束的时间 通过一个全局变量 # encoding=utf-8 import threading,time,Queue,random Read More
posted @ 2017-07-20 14:04 emily-qin Views(3004) Comments(0) Diggs(0) Edit
1、Threading模块提供的类 Thread,Lock,Rlock,Condition,Semaphore,Event,Timer,local 2、threading模块提供的常用的方法 (1)threading.currentThread(): 返回当前的线程变量。 (2)threading. Read More
posted @ 2017-07-20 14:02 emily-qin Views(519) Comments(0) Diggs(0) Edit