>many of the methods modify the same variables, there is nothing to prevent
>separate threads from entering two seperate synchronized methods and thus
That's what synchronized methods do. They prevent more that one thread
from executing any synchronized method of an instance of the class. You
probably meant that two threads could execute synchronized methods of two
separate instances concurrently, and those methods modify class variables.
Therefore the class variables can be modified concurrently.
I suggest you submit your changes as a patch at the sourceforge web site.
Samuele Pedroni is working on bringing Jython classes up-to-date with
newer Python specifications.
From: Mason, Jonathan [mailto:jmason04@...]
Sent: Monday, February 16, 2004 3:35 PM
Subject: [Jython-users] Is PythonInterpreter threadsafe?
There has been some debate about this topic. In my investigations, I have
that there are some places where Jython is not completely threadsafe.
Particularly when creating new java classes in the PyJavaClass object.
are several class variables that can be read and written to concurrently.
is a deceptive bug in that most of the methods are synchronized, however,
many of the methods modify the same variables, there is nothing to prevent
separate threads from entering two seperate synchronized methods and thus
have the capability to modify the same variable from those two methods.
I have tried to contact the administrators of the jython project with the
updates I have made, in the hopes that they can eventually be brought into
jython source, but to no avail. What should I do? I will be more than
send in the source code, but I don't particularly want to spam the whole
list with the large file attachments.
SF.Net is sponsored by: Speed Start Your Linux Apps Now.
Build and deploy apps & Web services for Linux with
a free DVD software kit from IBM. Click Now!
Jython-users mailing list