2019年5月7日
摘要: # -*- coding: utf-8 -*- """ 主线程要等到所有非守护线程结束,才能结束。 db.json----->{"count":1} """ import json from threading import Thread, Lock import time def search(name): with open('db.json', 'rt', encoding='... 阅读全文
posted @ 2019-05-07 18:58 QzkRainPig 阅读(354) 评论(0) 推荐(0) 编辑
摘要: 方式一、 方式二、 阅读全文
posted @ 2019-05-07 18:56 QzkRainPig 阅读(177) 评论(0) 推荐(0) 编辑
摘要: IPC机制:(解决进程间的数据隔离问题) 进程间通信:IPC(inter-Process Comminication) 创建共享的进程列队,Queue 是多进程的安全列队,可以使用Queue 实现多进程之间的数据传递 底层实现:管道+锁的方式实现 二、消费者生产者模型实现 阅读全文
posted @ 2019-05-07 18:46 QzkRainPig 阅读(437) 评论(1) 推荐(0) 编辑