Thanks. I looked at the servlet code.

The PySystemState cannot be shared by multiple PythonInterpreter objects.

What if I have multiple PythonInterpreters executing some code in different threads? Can I share the PySystemState between them?

On Wed, Oct 10, 2012 at 2:00 PM, Jarosław Szczepankiewicz <jszczepankiewicz@gmail.com> wrote:
> 5. From what I know, jython is not multi-threaded, nor is threadsafe. The
> class "org.python.core.PySystemState" cannot be shared between multiple
> instances.
>

This is probably not 100% correct please see usage PySystemState and
python interpeter in Modjyservlet:

http://www.jarvana.com/jarvana/view/org/python/jython-standalone/2.5.2/jython-standalone-2.5.2-sources.jar!/com/xhaus/modjy/ModjyJServlet.java?format=ok

Servlet is by design not thread safe so they will be using some
synchronisation if the PySystemState was not thread safe.



--
Santosh Tiwari
tiwaris@gmail.com