Using multiprocessing 2.6.2.1 package in Jython

自闭症网瘾萝莉.ら 提交于 2019-12-07 12:46:26

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!