The Unix Heritage Society mailing list
 help / color / mirror / Atom feed
From: downing.nick@gmail.com (Nick Downing)
Subject: [TUHS] Were all of you.. Hippies?
Date: Sun, 26 Mar 2017 15:46:40 +1100	[thread overview]
Message-ID: <CAH1jEzbzL+GiYoLN=Yw0eip1UCEm+anOsoWTbEJpB0kvpcw-GA@mail.gmail.com> (raw)
In-Reply-To: <CAH1jEzb=ZzPMT6YWg9pbR4T=s_ckB4YFsBJnefj8AEatdBY_MQ@mail.gmail.com>

I think Noel put it very well, when I saw the read()/write()  vs
recvfrom()/sendto() stuff mentioned earlier I was going to say that part of
the contract of read()/write() is that they are stream oriented thus things
like short reads and writes should behave in a predictable way and have the
expected recovery semantics. So having it be boundary preserving or having
a header on the data would in my view make it not read()/write() even if
the new call can be overlaid on read()/write() at the ABI level. I think
the contract of a syscall is an important part of its semantics even if it
may be an "unwritten rule". However, Noel said it better: If it's not
file-like then a file-like interface may not be appropriate.

Having said that, Kurt raises an equally valid point which is that the
"every file is on a fast locally attached harddisk" traditional unix
approach has serious problems. Not that I mind the simplicity: contemporary
systems had seriously arcane file abstractions that made file I/O useless
to all but the most experienced developer. I come from a microcomputer
background and I am thinking of Apple II DOS 3.3, CP/M 2.2 and its FCB
based interface and MSDOS 1.x (same). When MSDOS 2.x came along with its
Xenix-subset file API it was seriously a revelation to me and others.
Microcomputers aside, my understanding is IBM 360/370 and contemporary DEC
OS's were also complicated to use, with record based I/O etc.

So it's hard to criticize unix's model, but on the other hand the lack of
any nonblocking file I/O and the contract against short reads/writes (but
only for actual files) and the lack of proper error reporting or recovery
due to the ASSUMPTION of a write back cache, whether or not one is actually
used in practice... makes the system seriously unscaleable, in particular
as Kurt points out, the system is forced to try to hide the network
socket-like characteristics of files that are either on slow DMA or
PIO/interrupt based devices (think about a harddisk attached by serial
port, something that I actually encountered on a certain cash register
model and had to develop for back in the day), or an NFS based file, or
maybe a file on a SAN accessed by iSCSI, etc.

Luckily I think there is an easy fix, have the OS export a more socket-like
interface to files and provide a userspace compatibility library to do
things like detecting short reads/writes and retrying them, and/or blocking
while a slow read or write executes. It woukd be slightly tricky getting
the EINTR semantics correct if the second or subsequent call of a multipart
read or write was interrupted, but I think possible.

On the other hand I would not want to change the sockets API one bit, it is
perfect. (Controversial I know, I discussed this in detail in a recent
post).

Nick

On Mar 26, 2017 12:46 PM, "Kurt H Maier" <khm at sciops.net> wrote:

On Sat, Mar 25, 2017 at 09:35:20PM -0400, Noel Chiappa wrote:
>
> For instance, files, as far as I know, generally don't have timeout
> semantics. Can the average application that deals with a file, deal
reasonably
> with the fact that sometimes one gets half-way through the 'file' - and
things
> stop working?  And that's a _simple_ one.

The unwillingness to even attempt to solve problems like these in a
generalized and consistent manner is a source of constant annoyance to
me.  Of course it's easier to pretend that never happens on a "real"
file, since disks never, ever break.

Of course, there are parts of the world that don't make these
assumptions, and that's where I've put my career, but the wider IT
industry still likes to pretend that storage and networking are
unrelated concepts.  I've never understood why.

khm
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://minnie.tuhs.org/pipermail/tuhs/attachments/20170326/daa64e6b/attachment.html>


  parent reply	other threads:[~2017-03-26  4:46 UTC|newest]

Thread overview: 90+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-26  1:35 Noel Chiappa
2017-03-26  1:45 ` Kurt H Maier
     [not found]   ` <CAH1jEzb=ZzPMT6YWg9pbR4T=s_ckB4YFsBJnefj8AEatdBY_MQ@mail.gmail.com>
2017-03-26  4:46     ` Nick Downing [this message]
2017-03-26  2:49 ` ron minnich
2017-03-26  3:01 ` Andrew Warkentin
  -- strict thread matches above, loose matches on Subject: below --
2017-03-27  3:36 Doug McIlroy
2017-03-26  3:32 Noel Chiappa
2017-03-26  3:51 ` Dan Cross
2017-03-26 11:31   ` Ron Natalie
2017-03-26 22:06     ` Larry McVoy
2017-03-26 23:29       ` Wesley Parish
2017-03-27  4:20     ` Dave Horsfall
2017-03-26  4:31 ` Warner Losh
2017-03-26  3:11 Noel Chiappa
2017-03-26  3:17 ` Andrew Warkentin
2017-03-26  3:21 ` Kurt H Maier
2017-03-26  3:49 ` Dan Cross
2017-03-26  3:55 ` ron minnich
2017-03-26 16:26 ` Lyndon Nerenberg
2017-03-26 16:40   ` Larry McVoy
2017-03-26 18:35     ` Steve Simon
2017-03-26 20:05     ` Andy Kosela
2017-03-26  1:16 Noel Chiappa
2017-03-24 13:41 Noel Chiappa
2017-03-23 16:22 Noel Chiappa
2017-03-23 23:40 ` Wesley Parish
2017-03-22 17:49 Noel Chiappa
2017-03-22 22:35 ` Nick Downing
2017-03-23  8:56   ` shawn wilson
2017-03-23 13:13     ` Chet Ramey
2017-03-23 14:00   ` Tim Bradshaw
2017-03-20 23:28 Doug McIlroy
     [not found] ` <CAH_OBifeRyD__=TKTa=bMtFBMg9LsrCOyB+sSrO54Ezc-+zJbw@mail.gmail.com>
2017-03-21  1:24   ` shawn wilson
2017-03-21 16:20     ` Ron Natalie
2017-03-21  1:45 ` Derrik Walker v2.0
2017-03-20 22:17 Noel Chiappa
2017-03-21 12:19 ` Steffen Nurpmeso
2017-03-21 12:48 ` arnold
2017-03-21 13:29 ` Jason Stevens
2017-03-23 10:13   ` Steffen Nurpmeso
2017-03-23 12:08     ` Jason Stevens
2017-03-20 21:48 Steffen Nurpmeso
2017-03-20 22:10 ` Dave Horsfall
2017-03-20 22:32   ` Ron Natalie
2017-03-20 23:05     ` ron minnich
2017-03-21  2:51       ` Nick Downing
2017-03-21 20:28       ` Josh Good
2017-03-23 20:18         ` Michael Parson
2017-03-23 20:51           ` ron minnich
2017-03-24  0:18             ` Josh Good
2017-03-24  0:27               ` Larry McVoy
2017-03-24  1:03                 ` ron minnich
2017-03-24  1:05                   ` Larry McVoy
2017-03-24  2:33                   ` Andrew Warkentin
2017-03-24  5:17                     ` Random832
2017-03-24  5:37                     ` Erik E. Fair
2017-03-24 13:33                       ` Random832
     [not found]                     ` <20170324034915.GA23802@mcvoy.com>
2017-03-25  0:41                       ` Andrew Warkentin
2017-03-25  5:01                         ` Random832
2017-03-25 12:48                           ` Andrew Warkentin
2017-03-24  5:14                   ` Random832
2017-03-24  6:06                     ` ron minnich
2017-03-25  0:02                       ` Dave Horsfall
2017-03-25  0:42                         ` Toby Thain
2017-03-24  7:23                     ` shawn wilson
2017-03-24 23:55                       ` Josh Good
2017-03-25  3:55                         ` ron minnich
2017-03-25  4:52                           ` Steve Johnson
2017-03-25 13:48                             ` Jason Stevens
2017-03-25 18:51                           ` Clem Cole
2017-03-25 22:26                           ` Josh Good
2017-03-26  2:52                             ` Clem Cole
2017-03-24 10:21                   ` Tim Bradshaw
2017-03-24 13:55                     ` Random832
2017-03-24 14:53                       ` Tim Bradshaw
2017-03-24  2:33                 ` Dan Cross
2017-03-24  3:53                 ` Clem Cole
2017-03-24  7:15                 ` shawn wilson
2017-03-24  7:37                   ` Kurt H Maier
2017-03-24  8:06                     ` shawn wilson
2017-03-24 15:22                       ` Dan Cross
     [not found]                         ` <CALMnNGj6jcM5E1jJtxSnhnyQPBV7Hn4B06=tm1vv0TfKV=Bs1A@mail.gmail.com>
2017-03-24 22:09                           ` Dan Cross
2017-03-24 15:34                       ` Chet Ramey
2017-03-24 15:30                     ` Chet Ramey
2017-03-24 17:09                       ` Kurt H Maier
2017-03-20 23:08     ` Dave Horsfall
2017-03-21  0:10       ` Dan Cross
2017-03-21  2:09         ` Dave Horsfall
2017-03-22 12:50     ` Tim Bradshaw
2017-03-22 15:27       ` Dave Horsfall

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='CAH1jEzbzL+GiYoLN=Yw0eip1UCEm+anOsoWTbEJpB0kvpcw-GA@mail.gmail.com' \
    --to=downing.nick@gmail.com \
    /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).