Skip to content

Some multiprocessing APIs should be possible to import or use even when multiprocessing itself isn't available #134634

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
mhsmith opened this issue May 24, 2025 · 3 comments
Labels
OS-android OS-ios type-feature A feature request or enhancement

Comments

@mhsmith
Copy link
Member

mhsmith commented May 24, 2025

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 (aka multiprocessing.pool.ThreadPool) currently depends on the multiprocessing synchronization primitives, when it could use the threading equivalents instead.

  • multiprocessing.synchronize throws 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

@mhsmith mhsmith added type-bug An unexpected behavior, bug, or error OS-ios OS-android labels May 24, 2025
@terryjreedy terryjreedy added type-feature A feature request or enhancement and removed type-bug An unexpected behavior, bug, or error labels May 24, 2025
@terryjreedy
Copy link
Member

terryjreedy commented May 24, 2025

(EDIT) I have no idea is these changed would be acceptible. In any case, we cannot/will-not grab other people's code. Someone with 'ownership' of chaquopy would have to sign our Contributor Licensing Agreement and submit a PR with their code. Or someone else (you?) would have to write new code that does not violate their copyright.

@freakboy3742
Copy link
Contributor

@terryjreedy FTR: @mhsmith is the founder and principal author of Chaquopy.

@mhsmith
Copy link
Member Author

mhsmith commented May 25, 2025

Yes, I've already signed the CLA, and, if the fact that it's MIT licensed isn't already sufficient, I hereby give permission for anyone to contribute Chaquopy code to CPython.

However, a proper upstream solution will probably look a bit different to the monkey patches. I only linked to them to demonstrate that this could be fixed with a relatively small change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
OS-android OS-ios type-feature A feature request or enhancement
Projects
None yet
Development

No branches or pull requests

3 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy