[Ironruby-core] Interrupt Execution

Aaron Clauson lists at ruby-forum.com
Thu Jul 9 01:05:06 EDT 2009


Hi,

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
http://dlr.codeplex.com/Wiki/View.aspx?title=Docs%20and%20specs 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."

Thanks,

Aaron Clauson
-- 
Posted via http://www.ruby-forum.com/.


More information about the Ironruby-core mailing list