> I know it's missing fork(), so it can't be too good at posix.
JdBP> For portability, I always recommend spawn*() over fork().
JdBP> Why ?
JdBP> Because fork() is expensive to implement on operating systems that use
JdBP> the "spawn" model (this includes almost all of them, from PC-DOS
JdBP> through OS/2 to several mainframe operating systems), whereas
JdBP> implementing spawn*() over fork/exec for operating systems that use
JdBP> the "fork" model (UNIX, essentially) as a library is relatively
JdBP> trivial and inexpensive.
I 100% totally agree with you. It is COMPLETE MADNESS that Posix
specified fork and exec instead of spawn.
JdBP> Almost all uses of fork() are part of a fork/exec sequence, which is
JdBP> merely spawn() in disguise anyway.
Yes, this is exactly right.
JdBP> The exceptions are system utilities that manipulate the user or group
JdBP> ID, which are usually non-portable anyway (most of the PC operating
JdBP> systems apply user IDs to the entire machine instead of to individual
JdBP> processes), and server processes that fork off copies of themselves to
JdBP> do work, which is a situation crying out for proper use of threads.
Absolutely. Fortunately I don't program in Posix, so I don't have
to deal with complete abortions like that. Anyway, perhaps we
should close this thread, because I get my jollies from heated
debate, not sitting around nodding at people. :-) BFN. Paul.
@EOT:
---
* Origin: X (3:711/934.9)
|