From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=unavailable autolearn_force=no version=3.4.4 X-Received: by 10.224.137.67 with SMTP id v3mr10451361qat.0.1379946734175; Mon, 23 Sep 2013 07:32:14 -0700 (PDT) X-Received: by 10.49.51.197 with SMTP id m5mr872849qeo.5.1379946732693; Mon, 23 Sep 2013 07:32:12 -0700 (PDT) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!news.eternal-september.org!news.eternal-september.org!feeder.eternal-september.org!news.glorb.com!d5no1616345qap.0!news-out.google.com!gv3ni1260qab.0!nntp.google.com!d5no1545090qap.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Mon, 23 Sep 2013 07:32:12 -0700 (PDT) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=105.236.242.232; posting-account=p-xPhAkAAADjHQWEO7sFME2XBdF1P_2H NNTP-Posting-Host: 105.236.242.232 References: <2f813569-5ff8-4c20-a5ab-8538e6514906@googlegroups.com> <6a978d1c-1922-448b-91f7-cf8a19eab1fd@googlegroups.com> <1lgdqz079ogp5.1ti8931i9me3x$.dlg@40tude.net> <8203a0cd-5238-4086-8ca0-1c6c1b3fec09@googlegroups.com> <1ixhazoag8y0l.4mpw6pmi83xm.dlg@40tude.net> <51a27fa6-027d-4655-a78c-6a582811e23f@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: Re: Anti-Ada FUD (rant) From: Peter Brooks Injection-Date: Mon, 23 Sep 2013 14:32:14 +0000 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Xref: news.eternal-september.org comp.lang.ada:17244 Date: 2013-09-23T07:32:12-07:00 List-Id: On Monday, 23 September 2013 14:54:43 UTC+2, Bill Findlay wrote: >=20 > 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. >=20 No, it doesn't lead to race conditions because the fork creates two separat= e instances, each with its own context. What costs do you know of from a la= ter exec? You can, if you wish, run two programs, on from each fork, you do= n'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 si= mply do the exec the following statement and have the parent suspend. Actua= lly, the man page for exec() recommends you do this and recommends leaving = the exec too late. >=20 >=20 > > What particular principles of software design does the mechanism violat= e? >=20 > Unnecessary coupling. >=20 Unnecessary? A program is always run from a context, with the single except= ion of init. It is highly unusual for a program to require none of its pare= nts context (I/O programs usually find it handy to have stdin and stdout de= fined for one thing). So the coupling of a child to its parent makes comple= te sense.=20 I'm not wishing to advocate Unix as a perfect solution, of course, though i= t'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 for= k/exec for processes. That's why I'm asking, if there's a genuine reason why there's something wr= ong 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.