[mercury-users] Native garbage collector for Mercury

Thomas Charles CONWAY conway at cs.mu.OZ.AU
Mon Sep 14 12:48:34 AEST 1998


Peter Schachte, you write:
> But how do you steal the io__state from the predicate that's running
> when the interrupt happens, and put it back when the interrupt closure
> completes?
> 
> This isn't a frivolous question.  For example, you might want to have
> some code reading from a buffer, and have an interupt handler copy
> code from DMA memory into the buffer.  So you *need* to pinch the
> io__state from the running code, modify it, and quietly put it back,
> so that the running code can read it.  I can't see how to abstract
> this process statelessly.

I'm not sure I quite understand the problem. Remember that the io__state
thing that you pass around is really only a `token' that enforces
sequentiality. If multiple pieces of code may modify a data structure
then of course there needs to be a locking/mutual exclusion mechanism
to mediate updates. Maybe you need to explain the problem in more
detail so that I can understand what you mean.

Thomas
-- 
Thomas Conway <conway at cs.mu.oz.au>
Nail here [] for new monitor.  )O+



More information about the users mailing list