harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nathan Beyer" <nbe...@gmail.com>
Subject Re: [drlvm][jitrino]-about exception handling
Date Mon, 06 Aug 2007 23:15:32 GMT
Locks must be released if code exits a synchronized region and an
exception being thrown is just one means of exiting a synchronized
region. If locks weren't released when an exception is thrown, this
would introduce the possibility (inevitability) for dead-lock in
correctly written code.

-Nathan

On 8/6/07, 史成荣 <icyrong@gmail.com> wrote:
> But it is said in Mark Stoodley's paper: Automatically Reducing Repetitive
> Synchronization with a Just-in-Time Compiler for Java(cgo'05) that "The
> exception handling infrastructure in IBM's JVM is already designed to track
> objects as they are locked and unlocked. It automatically unlock any locked
> objects when the exception occurs before any exception handler is executed
> or before the frame is deleted if there is no handler for the exception in
> the frame's method. This mechanism is orthogonal to synchronization
> elimination.
> In a JVM without such a mechanism, new catch blocks must be created to
> explicitly unlock the object if an exception occurs."
> And I had a look at chaprer 8 and 7.12 of JVM spec, didn't find any
> description about the releasing of the lock(s) when  the exception is
> thrown.
>
> Thanks,
> Chengrong
>
Mime
View raw message