interrupting Jython code from Java

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

interrupting Jython code from Java

Jason Sachs
I've got a Java application calling FreeMarker which can call methods on Jython objects, and would like to handle the case where there's a bug in my Jython code and somehow I have an infinite loop.

A java thread running a jython interpreter is no more and no less than a java 
Interrupting such a thread is just as difficult as interrupting a java 
thread, because the jython interpreter does not check for thread interrupted 
status. You might extend the interpreter to do this check, but then it would 
run slower. Since the interpreter can call any java code that does not 
necessarily check the interrupted status, such a check would not be a strong 
guarantee anyway.

Is this still the case for Jython 2.5.3 and 2.7.0?

Check out the vibrant tech community on one of the world's most
engaging tech sites,!
Jython-users mailing list
[hidden email]