[m-dev.] Stream2000

Fergus Henderson fjh at cs.mu.OZ.AU
Thu Nov 2 21:04:27 AEDT 2000


On 02-Nov-2000, Peter Ross <peter.ross at miscrit.be> wrote:
> On Thu, Nov 02, 2000 at 08:45:47PM +1100, Fergus Henderson wrote:
> > Using mutvar type from extras/concurrency would guarantee that
> > each get_mutvar or set_mutvar operation is atomic, but it
> > wouldn't guarantee that the putback_char operation itself is atomic,
...
> The concurrency mutvars have the additional property that the mutvar is
> either full or empty.  Attempting to take from an empty mutvar blocks
> until the mutvar is full again, hence the second call to get_mutvar will
> block until the first call to set_mutvar fills the mutvar again. So the
> operation would be atomic.

Oh, I see.  Yes, you're completely right.

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
                                    |  of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh>  |     -- the last words of T. S. Garp.
--------------------------------------------------------------------------
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