On Thu, 27 Jul 2000, Marc Saegesser wrote:
> I'm embedding several Tcl interpreters inside a JVM. I'm currently using
> Jacl, but will probably switch to TclBlend at some point in the future.
>
> I'm trying to work out the best approach for cleanly shutting down these
> embedded interpreters. If everything is running normally, I can post a
> TclEvent object whose processEvent() method calls Interp.dispose() and
> causes the event loop to terminate.
>
> The problem with this is that I don't see a way to stop an interpreter that
> has run amok. Suppose that Interp.eval() is processing a script that is
> stuck in an infinite loop. The notifier's event loop isn't processing new
> events to my shutdown TclEvent will never get processed. Is there a good
> method for aborting a call to Interp.eval()?
There is no way to do this in Jacl. The "how do I stop a runaway thread"
problem is a very tricky one. The best you can really do is put and event
into the queue and code your app so it notices the "quit now" event.
There is also no way to stop a looping interp in regular Tcl.
Sun tried to add an API that would let you kill a thread from another
thread, but it was later removed because it was a disaster.
Mo DeJong
Red Hat Inc
----------------------------------------------------------------
The TclJava mailing list is sponsored by Scriptics Corporation.
To subscribe: send mail to [EMAIL PROTECTED]
with the word SUBSCRIBE as the subject.
To unsubscribe: send mail to [EMAIL PROTECTED]
with the word UNSUBSCRIBE as the subject.
To send to the list, send email to '[EMAIL PROTECTED]'.
An archive is available at http://www.mail-archive.com/tcljava@scriptics.com