Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #30311

Re: A stream/pipe that fills only on demand...

From Robert Klemme <shortcutter@googlemail.com>
Newsgroups comp.lang.java.programmer
Subject Re: A stream/pipe that fills only on demand...
Date 2014-11-08 11:20 +0100
Message-ID <cc692oFj3pdU1@mid.individual.net> (permalink)
References <slrnm5p4h0.r49.avl@login.logic.tuwien.ac.at>

Show all headers | View raw


On 07.11.2014 10:34, Andreas Leitgeb wrote:
> Normally, when one has a pipe-stream, the pipe gets filled on
> one side, till its full, and drained on the other side while
> data is needed. If less data is needed, then the remaining data
> in the pipe is discarded. (simplified; no nitpicking, please)

That is not an accurate description of how this "normally" works.  If 
more data is in the pipe (which is just a queue) than is read it just 
sits there and will be retrieved later.  Nothing is discarded.

Also, whether a pipe is filled until it is full depends on the ratio 
between reading and writing speeds: if a reader is faster than the 
writer chances are that the pipe (read "bounded queue") never fills up.

All that assumes concurrent reading and writing.  That's where pipes are 
usually used.

Cheers

	robert

Back to comp.lang.java.programmer | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

A stream/pipe that fills only on demand... Andreas Leitgeb <avl@auth.logic.tuwien.ac.at> - 2014-11-07 09:34 +0000
  Re: A stream/pipe that fills only on demand... Steven Simpson <ss@domain.invalid> - 2014-11-07 10:00 +0000
    Re: A stream/pipe that fills only on demand... Andreas Leitgeb <avl@auth.logic.tuwien.ac.at> - 2014-11-07 15:14 +0000
  Re: A stream/pipe that fills only on demand... Martin Gregorie <martin@address-in-sig.invalid> - 2014-11-07 12:27 +0000
    Re: A stream/pipe that fills only on demand... Andreas Leitgeb <avl@auth.logic.tuwien.ac.at> - 2014-11-07 15:13 +0000
  Re: A stream/pipe that fills only on demand... Robert Klemme <shortcutter@googlemail.com> - 2014-11-08 11:20 +0100
  Re: A stream/pipe that fills only on demand... Nigel Wade <nmw@ion.le.ac.uk> - 2014-11-10 09:24 +0000
    Re: A stream/pipe that fills only on demand... Andreas Leitgeb <avl@auth.logic.tuwien.ac.at> - 2014-11-29 16:02 +0000

csiph-web