RE: JavaMemoryModel: RE: Question on memory models

From: David Holmes (
Date: Thu Jul 01 1999 - 18:49:47 EDT

> Because the fundamental issues raised by safe virtual method dispatch
> are the same as initialization safety. We have to come up with a
> mechanism to handle the first. That same mechanism could be used to
> implement initialization safety, if we decide to add initialization
> safety to the spec.

Consider this approach to the vtable:

- The vtable is stored in the class object
- The vtable is initialised during class loading and initialisation
- The first time any thread accesses an instance of a class in a way that
would require class loading (if it hasn't yet been done) it passes through
a synchronisation point (mutex, atomic instruction or explicit memory
barrier). Hence no visibility or ordering problems.

I don't think this helps solve the initialisation safety problem. This is
an issue of writing correct MP 'C' code - not defining what memory model
rules Java should or should not have. There is so much happening inside the
VM we don't know what actions pass through synchronisation points and what
don't. Trying to think "inside the VM" seems counter productive to me.


This is the JavaMemoryModel mailing list, managed by Majordomo 1.94.4.

To send a message to the list, email
To send a request to the list, email and put
your request in the body of the message (use the request "help" for help).
For more information, visit

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