[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: A few random I/O proposals



On Wed, 27 May 1992 17:33:50 PDT, Pavel Curtis <Pavel@parc.xerox.com> said:

>++ Flushing output

> I think that the right solution here, regardless of whether or not
> the Scheme I/O system grows out of its `toy' status, is a
> recommendation to implementations that, if (current-input-port) and
> (current-output-port) both refer to the same interactive I/O device
> (e.g., terminal), then operations getting input from
> (current-input-port) should flush all pending output on
> (current-output-port), if any.

I don't like this so much.  The ideal way that output should work is
for it to be unbuffered - buffering is really just a performance hack
adopted out of necessity.  Given that, I think that implementations
should be encouraged not to buffer output whenever it is reasonable to
assume that the potential losses from not buffering outweight the
gains from buffering.  In particular, I think that they should never
buffer output that is sent to a terminal, irrespective of whether or
not input is requested from that terminal.  With terminals, there is
essentially no loss from not buffering output, since programs can
generate unbuffered output faster than humans or terminals can handle.
And there are definite gains - I don't want to have to wait until a
Scheme program has generated 8k of text before seeing any of it.
Similarly, if a Scheme system is started up interactively, I don't
think that output to the inital (current-output-port) should be
buffered.  Implementors may also decide that output to pipes shouldn't
be buffered.

Of course, I'm not sure just how to nicely phrase the above.

david carlton
carlton@husc.harvard.edu

       Wait..  is this a FUN THING or the END of LIFE in Petticoat
       Junction??