[Tutor] Jython for mutlithreading and on multicore system

Wayne Werner waynejwerner at gmail.com
Mon Oct 17 20:52:11 CEST 2011


On Mon, Oct 17, 2011 at 11:13 AM, Ashish Gaonker <ashish.gec at gmail.com>wrote:

> Does Jython improve GIL issues of python by using JVM based threads?
> Will code work faster on Jython then CPython? Can anybody help me to
> understand this?


You can use the multiprocessing module (
http://docs.python.org/library/multiprocessing.html) that was developed to
sidestep the issue of the GIL, if you'd prefer to stay in pure Python.

I believe Jython does use JVM threads, and I have read that IronPython also
uses true threading, bypassing the GIL.

As far as what code runs faster, well that depends on your Python code! The
main reason that you would see a speedup  between the two implementations,
as far as threading goes, is if you were really spending a lot of time
waiting on the GIL.

Just doing a quick Google search for "python threading" results in several
good articles.

HTH,
Wayne
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20111017/01e0510c/attachment.html>


More information about the Tutor mailing list