Subject: Re: popen reentrant (was Re: SA/pthread and vfork)
To: Eduardo Horvath <eeh@netbsd.org>
From: Nathan J. Williams <nathanw@wasabisystems.com>
List: tech-kern
Date: 09/11/2003 12:53:17
Eduardo Horvath <eeh@netbsd.org> writes:
> OTOH, for a threaded process the entire fork()+exec() model is
> obsolescent. We should be able to change that to the equivalent
> of pthread_create()+exec() if it weren't for the whole file
> descriptor manipulation thing.
Well, exec() replaces the entire process image, so calling it from a
threaded process nukes the other threads and what they are doing. It's
true that many, many uses of fork()+exec() have better ways to be
accomplished in a threaded program, but sometimes you really *do* want
to start another process, not another thread.
- Nathan