[m-dev.] for review: stream I/O

Michael Day mcda at students.cs.mu.oz.au
Mon Oct 2 23:42:10 AEDT 2000


> Is this what we want?  If so, how do we enforce a total ordering
> when we want it?  This is important when, for example, we have one
> reader stream and one writer stream operating on the same file.

Use a single duplex_stream rather than two streams in that case. I
considered a number of wrapper predicates that take an io__state pair as
well as a stream pair to enforce total ordering for those cases when you
really need it, I assume that wouldn't be too hard to add.

> Of course, there are other times when it is positively
> advantageous not to enforce an ordering (e.g. in a program that
> reads concurrently from two different files).

Indeed :)

> I get the impression that two ideas are being conflated: the
> state being manipulated (e.g. the io__state, a string, a 
> queue(char) etc.) and some handle on some aspect of that state
> (e.g. a file id, offset into a string, end of a queue etc.)

<looks blank, searches for meaning of conflated in nearby dictionary>

Michael


--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to:       mercury-developers at cs.mu.oz.au
Administrative Queries: owner-mercury-developers at cs.mu.oz.au
Subscriptions:          mercury-developers-request at cs.mu.oz.au
--------------------------------------------------------------------------



More information about the developers mailing list