Re: JavaMemoryModel: A memory model for the masses

From: David F. Bacon (dfb@watson.ibm.com)
Date: Tue Nov 09 1999 - 08:43:32 EST


> Does anyone know of an approach to synch
> removal that could infer this properly?

i toyed with an idea i called "synchronization hoisting" a while back, but
never followed through on it (there's so much fat in java that the payoffs are
much bigger in the runtime).

i don't see how a compiler could optimize this case though.

it would be hard enough if pollLock and putLock were combined into a single
lock. then you'd need: escape analysis to prove that the Node objects are
never accessed anywhere else, and then CSE (common synchronization elimination)
that observes that the synchronizations on Node objects allocated in the
LinkedQueue constructor are always dominated by synchronizations on the same
object (the combined lock).

but with two different locks, i don't think so. or am i missing something?

david



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