问题
I'm new to Jython/Python world. I'm trying to install the multiprocessing package in Jython. However I'm getting following return message from the easy_install
Setup script exited with error: Compiling extensions is not supported on Jython
Is there any way I can install this package in Jython?
回答1:
You can't use it if multiprocessing
requires C extensions i.e., if you can't disable them and the module was not reimplemented for Jython in Java/pure Python. multiprocessing
module is included in the stdlib since Python 2.6. Current Jython supports Python 2.5.
There is no GIL in Jython so you can use threading
in many cases where you would use multiprocessing
in CPython.
回答2:
A few years ago I spoke with the author of multiprocessing (Jesse Noller) about the sensibility of including a version of multiprocessing in Jython. His response was similar to the one J.F. Sebastian posted - The multiprocessing module is intended to be a drop in replacement for the threading module as a way to get around CPython's GIL. Since Jython has no GIL, it makes no sense to support multiprocessing.
来源:https://stackoverflow.com/questions/9100909/using-multiprocessing-2-6-2-1-package-in-jython