The Unix Heritage Society mailing list
 help / color / mirror / Atom feed
From: Clem Cole <clemc@ccc.com>
To: Paul Winalski <paul.winalski@gmail.com>
Cc: The Eunuchs Hysterical Society <tuhs@tuhs.org>
Subject: Re: [TUHS] Unix APIs: elegant or not?
Date: Wed, 31 Oct 2018 13:22:08 -0400	[thread overview]
Message-ID: <CAC20D2OF9HLBH_8XmJ52v+BPvsFfEzrcvOy_ZEoQUmPR8sp51Q@mail.gmail.com> (raw)
In-Reply-To: <CABH=_VQ2U3UvtNSDtmMpfd2Ap9JT4Zbag0qYcN2yYwyYU5_TuQ@mail.gmail.com>

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

On Wed, Oct 31, 2018 at 12:51 PM Paul Winalski <paul.winalski@gmail.com>
wrote:

> For me one of the most important software design principles is that the
> simple and most common use cases should be the simplest for theuser to
> code.

It's OK if complicated things are complicated to code, but simple things
> should be kept simple.
>
+1 Amen.

>
> I've always thought that the UNIX file primitives very elegantly adhere
> to this principle.  Reading a file in UNIX is a simple open()/read().../close()
> sequence.  Contrast that with VMS's $QIO or IBM OS access methods, where
> the full complexity is not only exposed in the interface, it must be
> considered, set up, and controlled by the
> user for even the simplest operations.

As my friend Tom Texiera once so wisely observered, "*it was not so bad
that QIO had over a 1000 options, it was that each of them had to be test
for on each I/O.*"
I also remember having an argument with Culter about QIO vs UNIX I/O (he
was defending QIO at the time as it was 'better' - as being more
complete).   But I pointed out, that it was interesting that after stream
I/O was added to VMS, most DEC customers (and the internal language
libraries team) had switched to using stream (UNIX style I/O) for most
operations because it was simplier and just as fast.   It was one of the
few times, I saw Dave stop arguing as he really did not have a response.



> Multibuffered, asynchronous, interrupt-driven I/O is more complicated (if
> not downright clumsy) in UNIX than in VMS or OS/VS, but that's OK,
> IMO--it shifts the
> complexity burden to those doing complex things.
>
Exactly, those programs that need to do it, can when they need to.   That
said, because of our VMS experience, we added ASTs (which I tink are
simplier than UNIX signals) and a QIO like call to RTU because the
Real-Time customers coming from VMS needed (wanted) it.  Truth is async
I/O  was really useful for some special cases that we had customers that
really need use it.   But for the most part the simple UNIX 5 I/O calls
were good enough (athough I would still rather AST's).

BTW:  when we added threads we discovered that a lot of the need/use for
async I/O also went away and frankly much of the complexity (clumsiness) of
the async I/O code was not longer needed, as the threading to care of it
and certain was smaller and simplier.

Also, I'll agree it was a tad clumsy, but the old double-dd (ddd) program
(you can find it in the UUNET archives), uses two processes that
communicate via a pipe to do the same trick with a traditional (6th
edition) UNIX I/O system to do some of the same things.  Basically the two
processes, take turns between reading and writing.   Thus the asynchronous
is purely left in the kernel.  The user code is actually very simple.
 There is a pipe that passes a token back and forth as to when the next
read/write can start.  For old UNIX systems lacking async I/O, ddd(8)  was
only way I knew you get a tape drive such as QIC/4 or 8 mm, much less a 1/2
streamer to keep up.

Clem
ᐧ

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

  reply	other threads:[~2018-10-31 18:21 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-31  4:38 Warren Toomey
2018-10-31 15:47 ` Paul Winalski
2018-10-31 17:22   ` Clem Cole [this message]
2018-10-31 19:33     ` Lawrence Stewart
2018-10-31 20:57   ` G. Branden Robinson
2018-10-31 21:31   ` Dave Horsfall
2018-11-01  7:42     ` Pierre DAVID
2018-11-01 10:20       ` Dave Horsfall
2018-11-01 12:57         ` Clem Cole
2018-11-01 14:19           ` ron minnich
2018-11-01 14:41             ` Clem Cole
2018-11-01 16:43               ` Warner Losh
2018-11-01 16:48                 ` ron minnich
2018-11-01 16:56                   ` Warner Losh
2018-11-02  5:24                   ` Bakul Shah
2018-11-04 10:53         ` Chris Hanson
2018-11-04 15:34           ` ron minnich
2018-11-04 17:06             ` Warner Losh
2018-11-04 20:00               ` ron minnich
2018-11-04 18:52           ` Bakul Shah
2018-11-04 10:49 ` Chris Hanson
2018-11-04 12:28   ` arnold
2018-11-04 21:34     ` Chris Hanson
2018-11-05 14:11       ` Donald ODona
2018-11-04 13:35   ` Warner Losh
2018-11-04 19:47   ` Dave Horsfall
2018-11-01 15:39 Noel Chiappa
2018-11-04 22:29 Theodore Y. Ts'o
2018-11-04 22:37 Noel Chiappa
2018-11-05  4:04 ` 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=CAC20D2OF9HLBH_8XmJ52v+BPvsFfEzrcvOy_ZEoQUmPR8sp51Q@mail.gmail.com \
    --to=clemc@ccc.com \
    --cc=paul.winalski@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).