The Unix Heritage Society mailing list
 help / color / mirror / Atom feed
From: Dan Cross <crossd@gmail.com>
To: Noel Chiappa <jnc@mercury.lcs.mit.edu>
Cc: The Eunuchs Hysterical Society <tuhs@tuhs.org>
Subject: Re: [TUHS] Systematic approach to command-line interfaces
Date: Wed, 29 Sep 2021 15:04:23 -0400	[thread overview]
Message-ID: <CAEoi9W474m-1HNecqeiiae-=d_=mmPN3mDJVu545PPQCsp+N8A@mail.gmail.com> (raw)
In-Reply-To: <20210929180742.4E63218C0BE@mercury.lcs.mit.edu>

[-- Attachment #1: Type: text/plain, Size: 3553 bytes --]

On Wed, Sep 29, 2021 at 2:08 PM Noel Chiappa <jnc@mercury.lcs.mit.edu>
wrote:

>     > From: Larry McVoy
>
>     > If you read(2) a page and mmap()ed it and then did a write(2) to the
>     > page, the mapped page is the same physical memory as the write()ed
>     > page. Zero coherency issues.
>
> Now I'm confused; read() and write() semantically include a copy operation
> (so there are then two copies of that data chunk, and possible consistency
> issues between them), and the copied item is not necessarily page-sized (so
> you can't ensure consistency between the original+copy by mapping it in).
> So
> when one does a read(file, &buffer, 1), one gets a _copy of just that byte_
> in the process' address space (and similar for write()).
>
> Yes, there's no coherency issue between the contents of an mmap()'d page,
> and
> the system's idea of what's in that page of the file, but that's a
> _different_ coherency issue.
>
> Or am I confused?
>

I think that mention of `read` here is a bit of a red-herring; presumably
Larry only mentioned it so that the reader would assume that the read
blocks are in the buffer cache when discussing the write vs mmap coherency
issue with respect to unmerged page and buffer caches (e.g., `*p = 1;`
modifies some page in the VM cache, but not the relevant block in the
buffer cache, so a subsequent `read` on the mmap'd file descriptor won't
necessarily reflect the store).

I don't think that is strictly necessary, though; presumably the same
problem exists even if the file data isn't in block cache yet.

PS:
>     > From: "Greg A. Woods"
>
>     > I now struggle with liking the the Unix concept of "everything is a
>     > file" -- especially with respect to actual data files.  Multics also
> got
>     > it right to use single-level storage -- that's the right abstraction
>
> Oh, one other thing that SLS breaks, for data files, is the whole Unix
> 'pipe'
> abstraction, which is at the heart of the whole Unix tools paradigm. So no
> more 'cmd | wc' et al. And since SLS doesn't have the 'make a copy'
> semantics of pipe output, it would be hard to trivially work around it.
>

I don't know about that. One could still model a pipe as an IO device;
Multics supported tapes, printers and terminals, after all. It even had
pipes!
https://web.mit.edu/multics-history/source/Multics/doc/info_segments/pipes.gi.info

Yes, one could build up a similar framework, but each command would have to
> specify an input file and an output file (no more 'standard in' and 'out'),


Why? To continue with the Multics example, it supported `sysin` and
`sysprint` from PL/1, referring to the terminal by default.


> and then the command interpreter would have to i) take command A's output
> file
> and feed it to command B, and ii) delete A's output file when the whole
> works
> was done. Yes, the user could do it manually, but compare:
>
>   cmd aaa | wc
>
> and
>
>   cmd aaa bbb
>   wc bbb
>   rm bbb
>
> If bbb is huge, one might run out of room, but with today's 'light my cigar
> with disk blocks' life, not a problem - but it would involve more disk
> traffic, as bbb would have to be written out in its entirety, not just
> have a
> mall piece kept in the disk cache as with a pipe.
>

It feels like all you need is a stream abstraction and programs written to
use it, which doesn't seem incompatible with SLS. Perhaps the argument is
that in a SLS system one wouldn't be motivated to write programs that way,
whereas in a program with a Unix-style IO mechanism it's more natural?

        - Dan C.

[-- Attachment #2: Type: text/html, Size: 4861 bytes --]

  reply	other threads:[~2021-09-29 19:05 UTC|newest]

Thread overview: 84+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-29 18:07 Noel Chiappa
2021-09-29 19:04 ` Dan Cross [this message]
2021-09-29 19:12 ` Larry McVoy
  -- strict thread matches above, loose matches on Subject: below --
2021-10-01 12:11 Paul Ruizendaal
2021-09-30 11:41 Douglas McIlroy
2021-09-28 18:15 Noel Chiappa
2021-08-03 19:12 Douglas McIlroy
2021-08-03 15:01 Douglas McIlroy
2021-08-03 17:13 ` Tom Lyon via TUHS
2021-08-11 18:11   ` Tom Ivar Helbekkmo via TUHS
2021-08-11 21:24     ` Tom Lyon via TUHS
2021-08-02  2:42 Douglas McIlroy
2021-08-02 14:58 ` Theodore Ts'o
2021-08-02 18:15   ` Adam Thornton
2021-08-02 18:24     ` Warner Losh
2021-08-02 20:55     ` John Cowan
2021-08-02 21:06       ` Jon Steinhart
2021-08-02 21:25         ` Dan Cross
2021-08-02 21:59           ` Jon Steinhart
2021-08-02 22:33             ` John Cowan
2021-08-03  0:21     ` Bakul Shah
2021-08-03  1:49       ` Jon Steinhart
2021-08-03  3:21         ` Adam Thornton
2021-08-03  3:27         ` Bakul Shah
2021-08-03  3:51           ` Jon Steinhart
2021-08-03  7:19   ` arnold
2021-08-03 23:12     ` Andrew Warkentin
2021-08-04 15:04       ` Paul Winalski
2021-07-31 16:47 Ron Young
2021-08-02  2:34 ` Jim Carpenter
2021-08-02  2:38   ` Ron Young
2021-07-31 16:27 Nelson H. F. Beebe
2021-07-31 12:25 Michael Siegel
2021-07-31 13:05 ` Dan Halbert
2021-07-31 14:21 ` Adam Thornton
2021-07-31 14:25   ` Adam Thornton
2021-07-31 15:45 ` Richard Salz
2021-07-31 16:03   ` Clem Cole
2021-07-31 16:06     ` Richard Salz
2021-07-31 16:21       ` Clem Cole
2021-07-31 16:17     ` Clem Cole
2021-07-31 16:30       ` Dan Cross
2021-07-31 15:56 ` Paul Winalski
2021-07-31 16:19   ` Dan Cross
2021-08-01 17:44     ` Chet Ramey
2021-08-01 21:53       ` Dan Cross
2021-08-01 23:21         ` Chet Ramey
2021-08-01 23:36         ` John Cowan
2021-08-01 23:49           ` Larry McVoy
2021-08-02  0:28             ` Larry McVoy
2021-08-01 23:58           ` Dan Cross
2021-08-02  0:29             ` Steve Nickolas
2021-08-02  0:13           ` Andrew Warkentin
2021-08-02  0:18             ` John Cowan
2021-08-02  0:54               ` Andrew Warkentin
2021-08-02  1:04               ` Dan Cross
2021-08-02  1:05             ` Theodore Ts'o
2021-08-02  2:10               ` Andrew Warkentin
2021-08-02  2:32               ` Bakul Shah
2021-08-02 17:33             ` Lars Brinkhoff
2021-09-28 17:46             ` Greg A. Woods
2021-09-28 18:10               ` Larry McVoy
2021-09-29 16:40                 ` Greg A. Woods
2021-09-29 16:57                   ` Larry McVoy
2021-09-30 17:31                     ` Greg A. Woods
2021-09-29 23:10               ` Phil Budne
2021-08-02 17:37           ` Lars Brinkhoff
2021-08-02 18:52             ` Clem Cole
2021-08-02 20:59               ` John Cowan
2021-08-02 21:06                 ` Al Kossow
2021-08-02 21:14                 ` Clem Cole
2021-08-02 21:13               ` Clem Cole
2021-08-01 16:51   ` Michael Siegel
2021-08-01 17:31     ` Jon Steinhart
2021-07-31 16:41 ` Clem Cole
2021-07-31 17:41   ` John Cowan
2021-07-31 17:30 ` Anthony Martin
2021-07-31 17:46   ` John Cowan
2021-07-31 18:56   ` Michael Siegel
2021-07-31 19:41     ` Clem Cole
2021-07-31 21:30       ` Michael Siegel
2021-08-01 17:48     ` Chet Ramey
2021-08-01 19:23       ` Richard Salz
2021-08-01 23:26         ` Chet Ramey

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='CAEoi9W474m-1HNecqeiiae-=d_=mmPN3mDJVu545PPQCsp+N8A@mail.gmail.com' \
    --to=crossd@gmail.com \
    --cc=jnc@mercury.lcs.mit.edu \
    --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).