Thu, 26 Jul 2001 16:44:57 +0200, George Russell <[EMAIL PROTECTED]> pisze:
> Is there a way in Glasgow Haskell to get a thread to wait on a
> child process in the same way as the Posix function wait(), and
> get the termination status of the child?
There is no easy way: all Haskell's thread run in the same process
and wait() blocks the whole process.
The only (or the only portable) way is to call wait() with WNOHANG
repeatedly in a thread and threadDelay for a short period of time
between calls.
This is what OCaml runtime does. It provides waiting for a process
as a threading primitive. It accounts for waiting in its select()
loop in the scheduler.
--
__("< Marcin Kowalczyk * [EMAIL PROTECTED] http://qrczak.ids.net.pl/
\__/
^^ SYGNATURA ZAST�PCZA
QRCZAK
_______________________________________________
Glasgow-haskell-users mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users