摘要:
1.同步锁 2.思索,递归锁 3.信号量,同步对象(了解即可) 4.队列 >生产消费者模型是依赖队列产生的 5.进程 并行&并行的区别 并发:是指系统具有处理多个任务(动作)的能力. 并行:是指系统具有同时处理多个任务(动作)的能力 并行是不是并发的一个子集 同步 与 异步 同步:当进程执行到一个I 阅读全文
摘要:
import threadingimport timedef music(): print("begin to listen %s" %time.ctime()) time.sleep(3) print("stop to listen %s" %time.ctime())def game(): pr 阅读全文
摘要:
import threading # 线程import timedef Hi(mun): print("hello %d" %mun) time.sleep(3)if __name__ == '__main__': t1 = threading.Thread(target=Hi,args=(10,) 阅读全文