Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using multiprocessing 2.6.2.1 package in Jython

Tags:

python

jython

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?

like image 836
testmann Avatar asked Jun 08 '26 05:06

testmann


2 Answers

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.

like image 185
jfs Avatar answered Jun 10 '26 19:06

jfs


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.

like image 36
Frank Wierzbicki Avatar answered Jun 10 '26 20:06

Frank Wierzbicki