Jython, GILs and object locking.

Alan Kennedy alanmk at hotmail.com
Fri Oct 10 05:57:35 EDT 2003


[Alan Kennedy]
>> Jython is implemented on top of java, which has built-in support
>> for fine-grained locking of individual objects. Therefore, the jython
>> implementers chose not to use a GIL, but instead to rely on the
>> fine-grained locking facilities of the Java platform to protect object
>> integrity.

[Peter Hansen]
> You seem to think there is a "Jython runtime interpreter" in the same
> way there is one for CPython...  Are you aware that Jython compiles
> your Python source to Java bytecode?

Compiles it to Java bytecode, which makes calls against a python
runtime which has been implemented in Java ..... 

All calls into the jython runtime require that the code execution be
associated with a PySystemState object, which keeps track of
"interpreter state" for the context in which the code is running
......

http://www.jython.org/docs/javadoc/org/python/core/PySystemState.html

So jython bytecode *is* executed by a jython interpreter, which is an
interpreter in all but name ......

The last link in the chain is the PythonInterpreter object, which
wraps the above, and provides some simple services to simplify using
the "interpreter".

http://www.jython.org/docs/javadoc/org/python/util/PythonInterpreter.html

>From what I can see, jython has pretty much, class for class, the same
structure as the cpython interpreter .....

-- 
alan kennedy
-----------------------------------------------------
check http headers here: http://xhaus.com/headers
email alan:              http://xhaus.com/mailto/alan




More information about the Python-list mailing list