摘要: 协程 微线程,切换执行 比如遇到IO等待的时候可以自动切换,提升线程利用率,多用在IO等待你想干点别的 阅读全文
posted @ 2025-09-16 23:11 fanqiang12321 阅读(6) 评论(0) 推荐(0)
摘要: class类里面先执行__new__,然后__init__ 单例模式 线程安全单例模式 点击查看代码 import threading class Singleton: instance = None lock = threading.Rlock() def __new__(cls, *args, 阅读全文
posted @ 2025-09-16 12:35 fanqiang12321 阅读(5) 评论(0) 推荐(0)