2009/1/4 Nathan Beyer <[email protected]>

> Could any of the IBM folks on the list get some advice from some class
> loader experts?
>
> -Nathan
>

 Hi Nathan,

from reading the description I can describe how Jikes RVM avoids this
problem (I'm not an IBM VME expert and I've not run the test case to check
that Jikes RVM passes it). In Jikes RVM we have two variants of all calls,
ones to unresolved methods and ones to resolved methods. Unresolved calls
are to classes whose initializer hasn't yet been run. If two threads are
calling a static method the first will resolve it and in the process acquire
a lock, the second thread must wait for the lock before it can attempt to
resolve the method (at which point it will discover the method was resolved
by the other thread and leave early). Checking for classes being resolved
litters all of the class loader code, and we're slightly proactive in
resolving in the case of reflected methods so that we needn't check for
resolution when performing reflected method invocation (which is now pretty
much unnecessary since [1] where we generate bytecodes at runtime to perform
reflection). An aside, I wrote a paper where I use the class loader as a
test case for optimizations based on stationary/immutable fields specified
via constraints [2], this work specialized the class loader to handle the
resolved case as a class is normally accessed when it is resolved (figures
in the paper).

Regards,
Ian Rogers

[1]
http://icooolps.loria.fr/icooolps2008/Papers/ICOOOLPS2008_paper08_Rogers_Zhao_Watson_final.pdf
[2] http://portal.acm.org/citation.cfm?id=1411746

Reply via email to