Buffered streams (was: RE: [Win32] VM Update for 2.7/2.8)
Lex Spoon
lex at cc.gatech.edu
Wed Jul 26 10:05:32 UTC 2000
Andres Valloud <sqrmax at prodigy.net> wrote:
> Hi Lex.
>
> > > Let's consider this scenario too. Suppose you have a dirty buffer from 0 to
> > > 100. Then you set the position 200 and send nextPutAll:. So you shouldn't
> > > flush.
> > It's unlikely that someone is going to position: back to spot 100 and
> > start increasing the buffer again. So, most implementations would just
> > do a flush whenever position: is called, anyway....
>
> Just consider peekFor:. A client of it, nextChunk in PositionableStream.
> Flushing or attempting to flush everytime position: is sent is not a
> good idea (been there).
>
Well, the root problem here is that #peekFor: should really be
implemented using #peek, don't you agree? #peek (and the missing
#peek:) should be much easier to manage than arbitrary position changes.
Anyway, a fair generalization is that buffering strategies can be as
complex as one feels like making them. Even so, there are surely a few
simple things that would perform well in most situations.
-Lex
More information about the Squeak-dev
mailing list
|