[Mono-list] How to implement the monitor synchronization?

Morten Sylvest Olsen pbk1105@pbk.dk
Wed, 14 Nov 2001 00:00:35 +0100 (CET)


On Wed, 14 Nov 2001, Rhys Weatherley wrote:

> Morten Sylvest Olsen wrote:
>
> > From what I could gather from the mcs classes the monitor Enter/Exit are
> > to be implemented with a native call.
>
> That's correct.  Although a clever engine could inline
> the calls to those methods within the JIT, and essentially
> "bring up" the implementation into the caller.  The final
> effect would be the same as the monitorenter/exit opcodes.

But wait a second! What happens when control is transfered out of the
basic block. Of course the compiler inserts call to monitor exit just
before method return, but what about when exceptions are thrown. The CLI
needs to release monitors when unwinding?

- Morten

A kind of Batman of contemporary letters.
		-- Philip Larkin on Anthony Burgess
----------------------------------------------------------
email: morten@bergsoe.k-net.dk,c958496@student.dtu.dk
addresse: Bergsøe Kollegiet v. 1105 2850 Nærum
----------------------------------------------------------