摘要: import asynciofrom inspect import iscoroutinefunctionfrom typing import Any, Awaitable, List​​class CoroutinePool: def __init__(self, max_size: int): 阅读全文
posted @ 2025-03-13 15:28 CJTARRR 阅读(15) 评论(0) 推荐(0)
摘要: import asyncio class AsyncReadWriteLock: def __init__(self): self._readers = 0 self._writers_waiting = 0 self._writer_active = False self._lock = asyn 阅读全文
posted @ 2025-03-13 15:07 CJTARRR 阅读(33) 评论(0) 推荐(0)
摘要: 背景 python利用多核就需要开启多进程,如果多进程之间需要共享数据又不希望引入第三方的服务,就需要使用共享内存。 multiprocessing.shared_memory python 3.8之后,python内置的multiprocessing库提供了一种新的共享内存方式,shared_me 阅读全文
posted @ 2025-03-13 09:45 CJTARRR 阅读(919) 评论(0) 推荐(0)