wait(2)

Simon Marlow simonmar@microsoft.com
Fri, 27 Jul 2001 09:55:23 +0100


> This is interesting, but not what I want.  I want something to wait on
> a real, Posix, child, _process_!!  Not a GHC thread.

Ah.  Oops :)

There's one other way that Marcin didn't mention: wait for SIGCHLD,
which can be done without blocking the whole process.  Unfortunately
there's no easy way  at the moment to tell *which* child generated the
SIGCHLD.

I guess we should really have a process wait as a threading primitive,
like OCaml does.  I've been looking at FreeBSD's `kevent' stuff recently
- they have a really nice way to wait for several different types of
event, including file descriptors, processes and even when a file is
modified (eg. tail -f).  Does Linux or Solaris have anything like this?
I had a quick look around but didn't find anything.

Cheers,
	Simon