comp.lang.ada
 help / color / mirror / Atom feed
From: Peter Brooks <peter.h.m.brooks@gmail.com>
Subject: Re: Anti-Ada FUD (rant)
Date: Mon, 23 Sep 2013 07:32:12 -0700 (PDT)
Date: 2013-09-23T07:32:12-07:00	[thread overview]
Message-ID: <dfed9737-1eaf-43d8-a8c3-ec7451950020@googlegroups.com> (raw)
In-Reply-To: <CE65F8A3.37211%yaldnif.w@blueyonder.co.uk>

On Monday, 23 September 2013 14:54:43 UTC+2, Bill Findlay  wrote:
> 
> It duplicates the parent program.  It should allow the program to be run to
> be specified as part of the fork.  Postponing that to a following exec
> imposes costs that are very often unnecessary, and it can lead to race
> conditions in establishing the new running program's context.
> 
No, it doesn't lead to race conditions because the fork creates two separate instances, each with its own context. What costs do you know of from a later exec? You can, if you wish, run two programs, on from each fork, you don't have to keep a previous version running.

If you want the same effect as a fork with an exec, it's easy to do, you simply do the exec the following statement and have the parent suspend. Actually, the man page for exec() recommends you do this and recommends leaving the exec too late.
> 
> 
> > What particular principles of software design does the mechanism violate?
> 
> Unnecessary coupling.
> 
Unnecessary? A program is always run from a context, with the single exception of init. It is highly unusual for a program to require none of its parents context (I/O programs usually find it handy to have stdin and stdout defined for one thing). So the coupling of a child to its parent makes complete sense. 

I'm not wishing to advocate Unix as a perfect solution, of course, though it's the best known so far. However, if I was going to design an OS from the ground up, in, ideally, Ada, to replace Unix, I'd certainly base it on fork/exec for processes.

That's why I'm asking, if there's a genuine reason why there's something wrong with fork/exec, I'm keen to know it, not as Unix bashing, but because I'd like to know what better solution there might be.

  reply	other threads:[~2013-09-23 14:32 UTC|newest]

Thread overview: 47+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-20 22:18 Anti-Ada FUD (rant) krfkeith
2013-09-20 22:47 ` Adam Beneschan
2013-09-20 23:32 ` John B. Matthews
2013-09-21 12:06 ` Georg Bauhaus
2013-09-22  0:47 ` gautier_niouzes
2013-09-22 21:24 ` Shark8
2013-09-23  4:43   ` Peter Brooks
2013-09-23  5:14     ` Nasser M. Abbasi
2013-09-23  6:05       ` Shark8
2013-09-23 23:19         ` Nasser M. Abbasi
2013-09-24  7:10           ` Bill Richards
2013-09-23  7:00       ` Bill Richards
2013-09-23  7:55         ` Bill Findlay
2013-09-23  8:31           ` Peter Brooks
2013-09-23  8:37           ` Bill Richards
2013-09-23  8:52             ` Bill Findlay
2013-09-23  8:59         ` Georg Bauhaus
2013-09-23 11:31           ` Bill Richards
2013-09-29  1:04           ` Shmuel Metz
2013-09-24  1:40         ` Paul Rubin
2013-09-24  7:05           ` Bill Richards
2013-09-24  7:34             ` Bill Findlay
2013-09-24  7:49               ` Bill Richards
2013-09-24 10:47                 ` Georg Bauhaus
2013-09-24 10:38             ` Georg Bauhaus
2013-09-24 15:39               ` Paul Rubin
2013-09-28 23:28         ` Shmuel Metz
2013-09-23  5:55     ` Shark8
2013-09-23  6:12       ` Peter Brooks
2013-09-23  7:34         ` Dmitry A. Kazakov
2013-09-23  8:36           ` Peter Brooks
2013-09-23  9:36             ` Dmitry A. Kazakov
2013-09-23  9:39               ` Bill Findlay
2013-09-23 12:16                 ` Peter Brooks
2013-09-23 12:54                   ` Bill Findlay
2013-09-23 14:32                     ` Peter Brooks [this message]
2013-09-23 22:06                       ` Peter C. Chapin
2013-09-29  1:00           ` Shmuel Metz
2013-09-23  7:26       ` Peter Brooks
2013-09-24  6:03         ` Shark8
2013-09-24  7:51           ` Peter Brooks
2013-09-26 20:58             ` erlo
2013-09-24  6:38 ` krfkeith
2013-09-24 23:18   ` Dennis Lee Bieber
2013-09-28  6:21     ` Shark8
2013-09-28 14:40       ` Per Sandberg
2013-09-28 21:54       ` Dennis Lee Bieber
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox