Some multiprocessing APIs should be possible to import or use even when multiprocessing itself isn't available
還沒有人認領這個 Issue。
- 主要語言
- Python
- 星號
- 77.2k
- 分支
- 36k
- PR 合併指標
- PR 指標待擷取
描述
Bug report
Bug description:
Android doesn't support multiprocessing because it doesn't support the System V IPC API, and iOS doesn't support subprocesses at all. However, there are a couple of things that should still work on these platforms, but currently don't:
-
multiprocessing.dummy.Pool(akamultiprocessing.pool.ThreadPool) currently depends on themultiprocessingsynchronization primitives, when it could use thethreadingequivalents instead. -
multiprocessing.synchronizethrows an exception on import if the synchronization primitives are unavailable. But this breaks some packages like joblib, which imports the primitives but doesn't always use them (joblib/joblib#825).
Chaquopy has some monkey patches to work around these issues, but it would be better if they were fixed upstream.
CPython versions tested on:
CPython main branch
Operating systems tested on:
Other
Linked PRs
- gh-148050
貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
研究方向
先檢視 multiprocessing.dummy.Pool 和 multiprocessing.pool.ThreadPool 進入點,接著檢查 multiprocessing.synchronize,以及它在沒有同步原語的平台上於匯入時失敗的情況。將所需行為與 threading 的對應功能進行比較,並檢視連結的 PR gh-148050;當受支援的 API 不需使用不可用的 multiprocessing 功能即可匯入或使用時,即表示完成。
由索引模型根據 Issue 內容生成。
評估
- 技術堆疊
- python
- 領域
- operating-systems
- Issue 類型
- 缺陷
- 難度
- 4/5
- 預估耗時
- 3-5 天
- 活躍度
- 停滯
- 描述清晰度
- 基本清楚
- 新手友好度
- 35/100