This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
Re: binary compatibility ABI
- From: Tom Tromey <tromey at redhat dot com>
- To: Bryce McKinlay <bryce at mckinlay dot net dot nz>
- Cc: "Boehm, Hans" <hans_boehm at hp dot com>, "'Andrew Haley'" <aph at redhat dot com>, Jeff Sturm <jsturm at one-point dot com>, java at gcc dot gnu dot org
- Date: 23 Sep 2003 11:00:54 -0600
- Subject: Re: binary compatibility ABI
- References: <38E7593C-E410-11D7-BD64-003065F97F7C@mckinlay.net.nz>
- Reply-to: tromey at redhat dot com
>>>>> "Bryce" == Bryce McKinlay <bryce@mckinlay.net.nz> writes:
Bryce> Actually, does the new Java memory model make any guarantees
Bryce> here?
Bryce> class X
Bryce> {
Bryce> static int a;
Bryce> void m()
Bryce> {
Bryce> System.out.println(Y.s);
Bryce> System.out.println(X.a);
Bryce> }
Bryce> }
Bryce> class Y
Bryce> {
Bryce> static int s;
Bryce> static
Bryce> {
Bryce> Y.s = 55;
Bryce> X.a = 25;
Bryce> }
Bryce> }
Bryce> Presumably, the first println is guaranteed to print '55'? But is the
Bryce> second println guaranteed to print '25'?
Yes, I think so, because class initialization acquires a lock, and
releasing the lock forces memory synchronization.
Tom