Jython Concurrency: Leveraging the Java Platform with Python

Java & JVM
Location: Portland 255
Average rating: ****.
(4.00, 8 ratings)

Jython implements the Python language, but we leverage the underlying
Java platform to provide an opinionated alternative to CPython in our
support of concurrency.

Because of the GIL and related infrastructure, CPython cannot use a
model in which threads perform concurrent computation defined in
Python on shared objects in the same process. (Of course, there are
workarounds, such as multiprocessing or using C extensions.)

In contrast, there’s no GIL in Jython. Jython instead embraces
threads, provides extensive support for managing their execution and
coordination through standard Java platform functionality
(java.util.concurrent), and threaded code works well with Jython’s
implementation of standard mutable collection types. Lastly, the
underlying JVM provides extensive instrumentation as well as the
ability to set a variety of parameters, including choice of GC.

This talk will go into a detailed discussion of some of the
interesting ramifications of these design points and how they can be
effectively applied to write concurrent code, as illustrated through a
variety of short examples.

Jim Baker


I work for Canonical as a software engineer on Ubuntu Server, specifically the open source Juju project to better support cloud computing through a service orchestration model. Juju uses Python/Twisted, as well as some Go, and relies on ZooKeeper for its distributed coordination semantics.

In my free time, I’m a committer on the Jython project. For Jython 2.5, it seems like I worked on nearly all aspects, including the compiler, concurrency, Unicode, and other aspects of builtin types. I also co-authored the Definitive Guide to Jython. For 2.6+, I’m involved in a collaboration with a compiler research group at the University of Colorado at Boulder, where we’ve been looking at how to improve Jython’s performance and support gradual typing (especially to improve Java integration).

My wife and I live near Boulder, with two wonderful kids, a Golden Retriever puppy, and a garage filled with skis, snowboards, snowshoes, various types of bicycles, a stand-up paddleboard, wind surfing sails, and other sundry sports equipment.


For information on exhibition and sponsorship opportunities at the conference, contact Sharon Cordesse at (707) 827-7065 or scordesse@oreilly.com.

View a complete list of OSCON contacts