Forum: IronRuby Interrupt Execution

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
6beced7e1914e4ed0b7232c73e6eac43?d=identicon&s=25 Aaron Clauson (aaronc)
on 2009-07-09 07:05

I'm still searching for a way to halt or interrupt the execution of an
IronRuby script. At the moment I do it by executing each script on a
separate thread and call Thread.Abort but that is resulting in a memory
and thread leak in my server application. As things have got busier on
the server the leak has reduced the time the server can stay up from
days to half a day or less.

I came across the DLR hosting document on CodePlex and was
wondering if there is anything in the IronRuby pipeline regarding
"Interrupt Execution" (chapter 3.4 page 27 of the spec)? It's exactly
what I'm after and also describes the exact issue I'm encountering with
the rude thread aborts. I've quoted the relevant text below for
interested parties.

Other than that is it possible to execute an IronRuby script line by
line? I have been able to execute individual expressions but as soon as
I try something like a multi-line expression like a case statement I
haven't been able to find a way.

"Interrupt Execution: Language supports DLR mechanisms for host to abort
execution cleanly so that host can interrupt runaway code.  If we allow
languages to avoid this work, then those langs cannot be used in the
host's process, cannot support in-situ REPLs for interactive
development, etc.  If the language uses DLR compilation or
interpretation, they should not need to do anything.  This is important
because if the host has to stop execution by calling Thread.Abort or
other rude abort, the thread could have transitioned into an unsafe
portion of the host's code.   This could happen via the script code
calling back on the host OM which in turn calls an internal API not
coded for rude aborts."


Aaron Clauson
6beced7e1914e4ed0b7232c73e6eac43?d=identicon&s=25 Aaron Clauson (aaronc)
on 2009-07-10 01:44
After spending a few hours delving into the DLR source I suspect the
"interrupt execution" implementation is more related to the DLR core
than IronRuby so I've posted a question over there


This topic is locked and can not be replied to.