Calling an external command from a Haskell program

Wolfgang Thaller wolfgang.thaller at
Wed Oct 22 20:49:30 EDT 2003

Volker Stolz wrote:

> On Wed, Oct 22, 2003 at 09:24:28AM +0100, Simon Marlow wrote:
>>> In local.libraries, you wrote:
>>>> The sticking point is that GHC needs a
>>>> thread-safe wait() implementation, which means some hacking in the
>>>> scheduler (there isn't even a good way to do this portably, because
>>>> select() doesn't let you wait for process termination).
>>> *mumbl* libevent *mumbl*
>> I checked libevent, and it doesn't support wait() events.  It would be
>> great if it did...
> You can catch sigCHLD in the main event-loop and then invoke wait().
> [This could even be possible in the current RTS by applying another
> incarnation of Wolfgang's pipe-hack]

Why another incarnation? The "first incarnation" should do the job, 
too. What's wrong with just safe-foreign-calling wait and relying on 
the threaded RTS to do the job?



More information about the Libraries mailing list