From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-0.5 required=5.0 tests=DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI autolearn=ham autolearn_force=no version=3.4.4 Received: from minnie.tuhs.org (minnie.tuhs.org [IPv6:2600:3c01:e000:146::1]) by inbox.vuxu.org (Postfix) with ESMTP id C57D221376 for ; Mon, 13 May 2024 00:57:28 +0200 (CEST) Received: from minnie.tuhs.org (localhost [IPv6:::1]) by minnie.tuhs.org (Postfix) with ESMTP id 070F843663; Mon, 13 May 2024 08:57:24 +1000 (AEST) Received: from mail-lj1-x22a.google.com (mail-lj1-x22a.google.com [IPv6:2a00:1450:4864:20::22a]) by minnie.tuhs.org (Postfix) with ESMTPS id 5AADC43308 for ; Mon, 13 May 2024 08:57:14 +1000 (AEST) Received: by mail-lj1-x22a.google.com with SMTP id 38308e7fff4ca-2e3b1b6e9d1so45884101fa.2 for ; Sun, 12 May 2024 15:57:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1715554631; x=1716159431; darn=tuhs.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=qJtdgGKu0lwfYcm6s8bsR6rcXooxoH+PPP3otG3BVYw=; b=hiHDsBk114NridtP50CGbL/UyVVauyB9B6ruCmFn4rtPwv3+OblioXI/J21EjSePQc 4fjDCN8ktRsQha/gk7Lx7QEh2jRxZXJPBo10Stu16bt4l9NQ2dLyByBzn8zaPNDIUXIM ae+/0NmGj3Q2SWY0hUymIsGIkzRfpzK/P3bQQetWqEmx7u4VVbjQRLwXNng0s/nzXD1o FBVzAVYUXgUNd3y5Y8uCJCOEA+iNYonIrnsjw+ExFVn9iAfKvkAongI6WsFlQC7iq5IF GOP8w55AISJrgBCyVL8AXUxu8WX8fC8oBE/CHUtUhW7CdEJ+LlA1km+eh+lUqg7TZfZe GWDg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715554631; x=1716159431; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=qJtdgGKu0lwfYcm6s8bsR6rcXooxoH+PPP3otG3BVYw=; b=Y2tTCMMJi7QysjCbsT/7gdx4ThoAk1+NkxyrrIM/6PLOwZQVe0hVIubdzXGaE7B3Bf pd/DVjzQCUhWckJE1AU7dPNQAWrAlKVHre06FGRCWR44lroV0JqF/hfzhVr41JUzrBwq W0/z+ig9v8CQJ3AeltKnnXcG+cy6mK566Ny1DhF/4EqkHB8riD4Zv6pr/kU5Gr0oYw6l ctXMCVwLGhotlP3hlWHtf+feCoFXukqoUGYRTou1O1oLoSjAUdPS6YF7bCr+sfpHDIYL HKohWgfqP76nztWFWJ6rOVw8nu4v54mvzydvRp1DdigAe8n8C78nOcCnpyINJcJjKNb0 oykA== X-Gm-Message-State: AOJu0YyjfrxOhCRNUrBALqwHXY80rTPsmogSMB4p3LYSvUbPeLj+am0X 7DufJ/U/7RNTEr8fn2KWahbFw8MqjKvN3PDEt/yaNPc+JvOA2Zekje9TnK+hTnGh23oM6IctMYc yhIW6Q6ZyJUdt58JDF9VQaBZPZvaEVd/g X-Google-Smtp-Source: AGHT+IFftfRbEMtoE+hNAVT49SzNXXilc4WZqHjceRBc/511YybkGel1djsDDSS/PVkzBs4U8yy+X+ffgV7e/9PF/ZI= X-Received: by 2002:a2e:a555:0:b0:2e1:a8db:2bca with SMTP id 38308e7fff4ca-2e5205e2972mr64642291fa.48.1715554631038; Sun, 12 May 2024 15:57:11 -0700 (PDT) MIME-Version: 1.0 References: <20240512194707.GL9216@mcvoy.com> <20240512201349.0DB6A8A9D055@ary.qy> In-Reply-To: <20240512201349.0DB6A8A9D055@ary.qy> From: Dan Cross Date: Sun, 12 May 2024 18:56:35 -0400 Message-ID: To: John Levine Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Message-ID-Hash: A375LI4TRA76VHW25RSQBYDD6EWOJG4Y X-Message-ID-Hash: A375LI4TRA76VHW25RSQBYDD6EWOJG4Y X-MailFrom: crossd@gmail.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: tuhs@tuhs.org X-Mailman-Version: 3.3.6b1 Precedence: list Subject: [TUHS] Re: forking, Re: [COFF] Re: On Bloat and the Idea of Small Specialized Tools List-Id: The Unix Heritage Society mailing list Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: On Sun, May 12, 2024 at 4:14=E2=80=AFPM John Levine wrote= : > It appears that Larry McVoy said: > >Perhaps a meaningless aside, but I agree on fork(). In the last major > >project I did, which was cross platform {windows,macos, all the major > >Unices, Linux}, we adopted spawn() rather than fork/exec. There is no w= ay > >(that I know of) to fake fork() on Windows but it's easy to fake spawn()= . > > The whole point of fork() is that it lets you get the effect of spawn wit= h > a lot less internal mechanism. Spawn is equivalent to: > > fork() > ... do stuff to files and environment ... > exec() > > By separating the fork and the exec, they didn't have to put all of > the stuff in the 12 paragraphs in the spawn() man page into the the > tiny PDP-11 kernel. Perhaps, but as I've written here before, `fork`/`exec` vs `spawn` is a false dichotomy. Another alternative is a `proccreate`/`procrun` pair, the former of which creates an unrunnable process, the latter of which marks it runnable. Coupled with a set of primitives to manipulate the state of an extant, but unrunnable, process and you have the advantages of fork/exec without the downsides (which are well-known; https://www.microsoft.com/en-us/research/uploads/prod/2019/04/f= ork-hotos19.pdf). Similarly, this gives you the functionality of spawn, without the downside of a singularly complicated interface. Could you have implemented that in something as small as the PDP-7? Perhaps not, but it does not follow that `fork` now remains a good primitive. My spelunking in the original GENIE documentation leads me to believe that its `fork` provided functionality similar to what I described. - Dan C.