[mercury-users] Exceptions and unique modes

Ralph Becket rbeck at microsoft.com
Fri Feb 16 02:53:25 AEDT 2001


>From Fergus Henderson on 15/02/2001 15:42:09
> 
> A better alternative, IMHO, is to ensure that no exceptions will be
> raised during those points, i.e. ensure that all updates to the
> io__state are atomic.  For store__set_mutvar and io__set_globals, this
> will come for free on most implementations, I think, since the crucial
> steps are just pointer assignments.

What happens when we store another unique object in a mutvar in the 
io__state (*), get it and perform some operation that raises an
exception before we've put it back?  The mutvar now no longer holds a
valid reference to our unique object, but the exception handler can't
know that.  In fact, it's impossible to work out whether the inst for
the io__state as delivered to the exception handler is "unique, containing
mutvar reference to dead value" or "unique, containing mutvar reference to
unique value."

(*) We'd need to extend the modes for {get,set}_mutvar.

> Anyway, currently we don't support asynchronous exceptions, so the
> issue doesn't arise.

Still, it's an interesting problem.

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

--------------------------------------------------------------------------
mercury-users mailing list
post:  mercury-users at cs.mu.oz.au
administrative address: owner-mercury-users at cs.mu.oz.au
unsubscribe: Address: mercury-users-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-users-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the users mailing list