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

Ralph Becket rbeck at microsoft.com
Mon Oct 2 21:56:11 AEDT 2000


I have a question about the semantics of stream based IO.

The io__state is there to enforce an order on IO operations.
The proposed stream interface seems to subvert that in that

	stream__init(/* whatever */, Stream, I00, IO1),
	<combination of operations on io__state and Stream>
	stream__destroy(Stream, IOn, IO)

does not place any total ordering constraint on the operations
in <...> - there is a total ordering on the Stream op's and
there is a total ordering on the IO ops, but not on the
combination of the two.

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.

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).

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.)

Can someone help out with an explanation?

Cheers,

Ralph

--
Ralph Becket      |      MSR Cambridge      |      rbeck at microsoft.com 

--------------------------------------------------------------------------
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