This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
Re: Static initializer elimination
- To: tromey at redhat dot com
- Subject: Re: Static initializer elimination
- From: Andrew Haley <aph at cambridge dot redhat dot com>
- Date: Tue, 16 Oct 2001 15:54:25 +0100 (BST)
- Cc: Bryce McKinlay <bryce at waitaki dot otago dot ac dot nz>,java-patches at gcc dot gnu dot org
- References: <3BCBF158.7020405@waitaki.otago.ac.nz><87d73naahv.fsf@creche.redhat.com>
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.