RE: JavaMemoryModel: FWD: Question regarding nested synchronized blocks

From: David Holmes (
Date: Mon Apr 22 2002 - 21:23:59 EDT

Ramki wrote:
> Programmers steeped in the posix tradition
> often tend to think of mutex_lock/_unlock
> as memory barriers of sorts. That might have
> been one source/rationale for the restriction below?

And programmers used to anything bar an aggressively optimisation JIT/VM
won't expect their code to get reordered much at all :-)

I still have concerns over how sync block merging can be specified such that
the "fairness" issues Bill mentioned can be dealt with. The classic example

  // access data structure

Both acquire and release are "sync blocks" but I certainly don't want them
to be merged.

David Holmes

JavaMemoryModel mailing list -

This archive was generated by hypermail 2b29 : Thu Oct 13 2005 - 07:00:39 EDT