On Mon, Jun 01, 2009 at 09:21:20PM +0100, James Mansion wrote:
> The WIN32 code path execs a copy of the tester as a subprocess to 
> isolate it.
> 
> Why isn't that the norm?  In the presence of pthreads you pretty much 
> have to do
> the same thing, and it can hardly be worth having a special case for the 
> legacy single
> thread UNIX behaviour now that threading is so pervasive.

It depends how you look at it.  If the testing code used pthreads in
its main process thread, then calling fork() would be relatively
hairy... but it doesn't, so fork() is safe.

To me, the Windows code is the special case: Emulating it on Unix
would require replacing CreateProcess with an explicit or implicit
fork-and-exec() pair... but once we have forked, there is not really
any point in calling exec(), since we are already in an isolated
process, which was what we wanted.

(While some Windows people consider Unix's fork() call a mistake, Unix
people generally consider CreateProcess() to be an odd hybrid of
fork(), exec*(), and a few other syscalls.  _De gustibus non est
disputandum_, I suppose.)

yrs,
-- 
Nick

_______________________________________________
Libevent-users mailing list
Libevent-users@monkey.org
http://monkeymail.org/mailman/listinfo/libevent-users

Reply via email to