摘要:
# -*- 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='... 阅读全文
摘要:
方式一、 方式二、 阅读全文
摘要:
IPC机制:(解决进程间的数据隔离问题) 进程间通信:IPC(inter-Process Comminication) 创建共享的进程列队,Queue 是多进程的安全列队,可以使用Queue 实现多进程之间的数据传递 底层实现:管道+锁的方式实现 二、消费者生产者模型实现 阅读全文