TIP: Click on subject to list as thread! ANSI
echo: os2prog
to: Jonathan de Boyne Pollard
from: Paul Edwards
date: 1995-11-10 22:41:52
subject: Knives And Forks

> 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)

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.