Brian Denheyer <briand@aracnet.com> wrote:
On Mon, 25 Jan 2010 23:19:53 -0800
Thomas DuBuisson <thomas.dubuisson@gmail.com> wrote:

> 1) Don't use System.Posix.Signals
> It isn't necessary and makes your code less portable
>
> 2) The POSIX SIGALRM is used/caught by the RTS and that is why you are
> seeing strange behavior.
>
> 3) Consider using Haskell exceptions from Control.Concurrent
> (throwTo). Not sure what you want to do but you can always
> "myThreadId >>= \tid -> forkIO $ threadDelay someDelayTime >>
> (throwTo tid someExceptionVal)"
>

I just want a routine to run every 15 min.


You can still use Control.Concurrent:
> import Control.Concurrent
>
> doEvent f usDelay = forkIO $
>   threadDelay usDelay
>   doEvent f usDelay
>   f

Or a wrapper around Control.Concurrent - Ex: The Control-Event package.


I'm not clear on why the throwTo is in you example.

It will give you an exception just like you were expecting from SIGALRM.

Thomas