The Unix Heritage Society mailing list
 help / color / mirror / Atom feed
From: Andrew Warkentin <andreww591@gmail.com>
To: The Eunuchs Historic Society <tuhs@tuhs.org>
Subject: [TUHS] Re: forking, Re: [COFF] Re: On Bloat and the Idea of Small Specialized Tools
Date: Sun, 12 May 2024 21:29:01 -0600	[thread overview]
Message-ID: <CAD-qYGp1io4FsTQSkXXUJ-w7S19u23eXxiBE5Jm9fy8+U20++w@mail.gmail.com> (raw)
In-Reply-To: <CAEoi9W51WC0R-ZTFz_AC_UY5K1OAjqf6158tG0K5bK1ofhmxuw@mail.gmail.com>

On Sun, May 12, 2024 at 4:57 PM Dan Cross <crossd@gmail.com> wrote:
>l.
>
> 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/fork-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.
>
IMO something like that is the best model (although it probably would
have been a bit complicated for a PDP-7/PDP-11). That's basically what
I'm doing in the OS that I'm writing
<https://gitlab.com/uxrt/uxrt-toplevel>. Processes will basically just
be containers for hierarchical groups of threads, and will have pretty
much no other state besides the command line. All of the context
normally associated with a process (file descriptor space,
permissions/UID/GID, filesystem namespace, virtual address space) will
instead be in separate objects that are explicitly bound to threads.
Separate APIs for creating an empty process, creating threads within
it, manipulating context objects and binding threads to them, and
starting the process will be provided (all of these APIs will use a
file-based transport underneath; this will be the first OS I know of
where literally everything is a file). The base process APIs will be
general enough to allow an efficient copy-on-write fork() to be
implemented on top of them for backwards compatibility and the
remaining use cases where forking still makes sense (since even all
process memory will be implemented with files, this will be
implemented with a special in-memory "shadow filesystem" that creates
alternate mappings of other memory filesystems).

Really I'd say there are actually several design decisions in
conventional Unix that made sense on a PDP-7 or PDP-11, but no longer
make sense in the modern world. For instance, the rather inflexible
security model with its fixed set of root-only system calls rather
than some form of role-based access control, or the use of on-disk
device nodes bound by numbers rather than something like separate
special filesystems for each driver that get union mounted together,
or the lack of integrated support for userspace filesystem servers
(yes, there's FUSE, but it's kind of a poorly integrated hack that is
rarely used for anything important).

  parent reply	other threads:[~2024-05-13  3:29 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-10 16:36 [TUHS] " Clem Cole
     [not found] ` <CAGg_6+Ov6hYTxQ5M-hEBoOiUQ0UVRP0V+aVi0STKAALLDUGY7g@mail.gmail.com>
     [not found]   ` <CAEoi9W7FbGZFhiddHWWqdivGFfgFAj9nsUApomswfP56rqTMpQ@mail.gmail.com>
     [not found]     ` <20240511213532.GB8330@mit.edu>
2024-05-12 19:34       ` [TUHS] Re: [COFF] " Adam Thornton
2024-05-12 19:47         ` Larry McVoy
2024-05-12 20:13           ` [TUHS] Re: forking, " John Levine
2024-05-12 22:56             ` Dan Cross
2024-05-12 23:34               ` Larry McVoy
2024-05-13  1:34                 ` Dave Horsfall
2024-05-13 13:21                   ` Larry McVoy
2024-05-13  3:29               ` Andrew Warkentin [this message]
2024-05-12 20:43         ` [TUHS] " Dave Horsfall
2024-05-13  2:33         ` Alexis
2024-05-13  2:57           ` Warner Losh
2024-05-13  5:23         ` markus schnalke
2024-05-13  6:18           ` Andrew Warkentin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAD-qYGp1io4FsTQSkXXUJ-w7S19u23eXxiBE5Jm9fy8+U20++w@mail.gmail.com \
    --to=andreww591@gmail.com \
    --cc=tuhs@tuhs.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).