When I use pyinstaller to package multi-processing programs, I can only use this multiprocessing. set_ start_ Method ('spawn '), otherwise the program will not run normally, but using spawn will increase memory overhead, so how can I solve this problem.
1 Like
Unfortunately, AFAIK that’s a fundamental limitation of how pyinstaller works, so you have to either:
- Use
pyinstaller
andmulitprocessing
and accept the overhead - Use a different parallelism model than multiprocessing (
asyncio
,threading
, subinterpreters, a third-party library, etc) - Use a different packaging method than pyinstaller that does support it
- Use a different Python interpreter than CPython, such as PyPy, Stackless, GraalPython, etc. which may support lighter-weight multiprocessing primitives
Best of luck.
1 Like