[MLton-user] signal handling an mllex based filter

Wesley W. Terpstra wesley at terpstra.ca
Tue Aug 4 12:48:41 PDT 2009


On Tue, Aug 4, 2009 at 7:47 AM, Michael Norrish <
Michael.Norrish at nicta.com.au> wrote:

> In Moscow ML, I did some magic to get SIGINT recognised as an Interrupt
> exception, and did
>  lexer() handle Interrupt => lexer()
>

> In MLton, I'm confused.
>
> I can handle SIGINT with MLton.Signal.setHandler, but it seems as if I am
> going to have to explicitly set myself up with a master thread that
> repeatedly creates slave threads to run lexer().  Then in the handler, I can
> just switch to the master, leaving the interrupted slave to expire through
> lack of attention.


Sounds like a reasonable approach. There is no way to raise an exception in
one thread from another, so you cannot interrupt the running lexer.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mlton.org/pipermail/mlton-user/attachments/20090804/ae5427e7/attachment.html


More information about the MLton-user mailing list