From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 9062 invoked from network); 3 Aug 2021 00:21:19 -0000 Received: from minnie.tuhs.org (45.79.103.53) by inbox.vuxu.org with ESMTPUTF8; 3 Aug 2021 00:21:19 -0000 Received: by minnie.tuhs.org (Postfix, from userid 112) id 7E4359CA98; Tue, 3 Aug 2021 10:21:16 +1000 (AEST) Received: from minnie.tuhs.org (localhost [127.0.0.1]) by minnie.tuhs.org (Postfix) with ESMTP id 403AF9CA63; Tue, 3 Aug 2021 10:20:49 +1000 (AEST) Authentication-Results: minnie.tuhs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=iitbombay-org.20150623.gappssmtp.com header.i=@iitbombay-org.20150623.gappssmtp.com header.b="gFjJgqRH"; dkim-atps=neutral Received: by minnie.tuhs.org (Postfix, from userid 112) id 2E2629CA63; Tue, 3 Aug 2021 10:20:45 +1000 (AEST) Received: from mail-ot1-f46.google.com (mail-ot1-f46.google.com [209.85.210.46]) by minnie.tuhs.org (Postfix) with ESMTPS id 384379CA60 for ; Tue, 3 Aug 2021 10:20:44 +1000 (AEST) Received: by mail-ot1-f46.google.com with SMTP id v9-20020a9d60490000b02904f06fc590dbso277432otj.4 for ; Mon, 02 Aug 2021 17:20:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iitbombay-org.20150623.gappssmtp.com; s=20150623; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=1J0pN99toc8qWq0o4w+5ArkROF3IHv6s+Cw35pofNMA=; b=gFjJgqRHbHERqudYVIGs2i5GU1XD8LJlv4n7Rlt+SzYVm9eSmvQRLk5/qi+CGcaZZH XDKfnmmuXsMaVt2WvJ1tp3VR1zptxFzXc8ySsft5Jm/w5Pi3eKPzMWwzx5HmqVnTHPuU Kecak5wUMSNWsXpNdrjgz6kw8aoxGOidvz6DfBuLn0WO4oszotGQ0C9blF8OYtNvJ0Bj dhB0jcpu1BRvKsxR3zqt6TW4LVsWaJKAVxbtKtcy5yWZlC2rDggDZWyonnh/FNL56q5s 8z+ga/ulLvsaru9/aiTIzg4a/bsuFwS4U7n8rP9eFSAtmuSjyRTxpY9gwN2WhYerjAqE EEwA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=1J0pN99toc8qWq0o4w+5ArkROF3IHv6s+Cw35pofNMA=; b=LGSQhBwnluTE/BKeGeLE51usuUkDo9NJeHGurouNDDJvH3OwTOKeUZJbHWqQgxTvXx tsclmnVeGeOiacZVAAwc13CXcGqfICUC4QMMG8GCi42FihhA5ND4g0eGhJh1zbaoW6Np A6Xt4QS3RNA9QENWSZgRE2oVaiSuGCski9VjTBHOxk/T4r3efzP3SDsrzngxihqrqihO a9pWYbXINP7VVeHbKSeqMlNKco9HAP9hY4StvvR5P8M5Ai9E48kNazOnLIDKHdGw6cP2 zlRoS+ITDXl1xvj4kdmmpI5tyQ8Os1LDYJ1skXEShJ0WwiMypfBMn7vPbrmHvwO85zFc YjUQ== X-Gm-Message-State: AOAM5328kKXVq1oZKrjLFu43oOu6MVHec3lMuorzVBOIeDUNjOhEUGXO LFNMNCjbwtIUyh5f/m3ZQobFAg== X-Google-Smtp-Source: ABdhPJzleinALs5Isdk1e3BSn+1xzt8iGmeVLDNnLEhqjnBbp3c3X4xGhZpeu4/OTgPLDqDN4D+BXQ== X-Received: by 2002:a9d:4d03:: with SMTP id n3mr13154046otf.223.1627950043339; Mon, 02 Aug 2021 17:20:43 -0700 (PDT) Received: from smtpclient.apple (107-215-223-229.lightspeed.sntcca.sbcglobal.net. [107.215.223.229]) by smtp.gmail.com with ESMTPSA id i205sm2110461oif.14.2021.08.02.17.20.42 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 02 Aug 2021 17:20:42 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.120.0.1.13\)) From: Bakul Shah In-Reply-To: Date: Mon, 2 Aug 2021 17:20:41 -0700 Content-Transfer-Encoding: quoted-printable Message-Id: References: <202108022106.172L6I1i135429@darkstar.fourwinds.com> To: Dan Cross X-Mailer: Apple Mail (2.3654.120.0.1.13) Subject: [TUHS] fork (Re: Systematic approach to command-line interfaces X-BeenThere: tuhs@minnie.tuhs.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: The Unix Heritage Society mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: The Eunuchs Hysterical Society Errors-To: tuhs-bounces@minnie.tuhs.org Sender: "TUHS" On Aug 2, 2021, at 2:25 PM, Dan Cross wrote: >=20 > Fork has served us well for more than five decades; I've got no = argument with that. However, should we never question whether it = continues to be the right, or best, abstraction as the environment = around it continues to evolve? An os with no fork() can be used to reimplement fork() for backward=20 compatibility. You will anyway need all the things fork() used to do in this brave new world. For example, you will need to specify which signals and file descriptors to inherit. Something like: jmp_buf state; pid =3D 0; if (!setjmp(state) && !pid) { fd =3D openAt(hostfd, "/n/address-space/new", ...); <> pid =3D breathe_life(fd, state, signals, fds); longjmp(state, 1); return pid; } The /n/address-space filesystem yields a new address space on a given host (as represented by the hostfd). You can then "copy" to it to fill it up from the current proc's memory. Copy should be done using COW if the new proc is on the same host (or even remote but that opens up another area of discussion...). breathe_life is given where everything is set up and it just has to create a new thread, associated with the address, wire up signals as file descriptors that are to be inherited and arrange things so that on return from syscall in the child, process state will be as per "state". If signals and fds can be wired up to a remote host, this can be used to "migrate" a process. There is likely much more process state in the kernel mode which would have to be packaged up somehow. There may be other breakage if the child & parent are on different hosts.