This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Static initializer elimination


Tom Tromey writes:
 > >>>>> "Bryce" == Bryce McKinlay <bryce@waitaki.otago.ac.nz> writes:
 > 
 > Bryce> Here is the famous static-initializer-elimination patch,
 > Bryce> which I am finally going to check in. I am pretty satisfied
 > Bryce> that it doesn't introduce any thread safety problems now,
 > Bryce> since it synchronizes on java.lang.Class to prevent
 > Bryce> concurrent modification of the class chain during dlopen()
 > Bryce> calls and during class registration by the interpreter.  The
 > Bryce> other dlopen call, in SharedLibClassLoader, is already
 > Bryce> appropriatly synchronized.
 > 
 > Thanks!  This is really great.

It is.

This got me thinking: are there any notes in the docs about "Static
Initializers considered Harmful"?

Andrew.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]