跳到主要內容
JarBun 罐兔筆記
文章
分類
關於
文章
分類
關於
← 回到首頁
#Concurrency
1 篇文章
2026年10月1日
Python Singleton:從 `__new__` 到 thread-safe metaclass,該怎麼實現?
用 Python 實現 Singleton:模組、__new__、metaclass 與 factory;理解 __init__、雙重檢查鎖、執行緒安全、多程序限制,以及何時不該使用。
#Python
#Design Pattern
#Singleton
#Concurrency