-
-
Notifications
You must be signed in to change notification settings - Fork 15
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
Stub doesn't work with multiprocessing #7
Comments
Note this requires beeware/Python-Apple-support#132 to include the |
The However, the more general issue with The issue is that Briefcase doesn't guarantee that there will be a
This is definitely something that should be addressed; some sort of logic in the stub app is required that verifies if the parent process is "self"; and if so, changes the interpretation of command line arguments so that |
For example, if you replace the if __name__ == '__main__':
import multiprocessing
import operator
import sys
print(f"{sys.argv=}")
if len(sys.argv) == 1:
multiprocessing.set_start_method("forkserver")
with multiprocessing.Pool(2) as p:
print(p.map(operator.neg, [1, 2, 3]))
If you remove the
Unfortunately, using |
Describe the bug
When multiprocessing is used to fork a subprocess, the main program entrypoint is executed in the subprocess rather than the Process target.
To Reproduce
create a
multiprocessing.Process()
and start it using.start()
The subprocess will call the parent process entry point.Expected behavior
The target function is called as the entrypoint of the subprocess
Screenshots
If applicable, add screenshots to help explain your problem.
Environment:
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: