Re: JavaMemoryModel: proposal for semantics & implementation on relaxed memory model machines

From: Doug Lea (dl@altair.cs.oswego.edu)
Date: Fri Jul 16 1999 - 16:51:11 EDT


Joe wrote:

> Doug Lea wrote:
>
> > But a compromise might be reached from this direction as well. Rather
> > than introducing a keyord that provides initialization safety as an
> > option, how about introducing a qualifier for fields that disables
> > this safety-first default. We could even hijack `transient'!
>
> I think this option should be pursued. I guess you're joking about
> transient, though, because it's already been hijacked by the
> java.io.Serializable interface, and is used quite a lot in Beans and EJBs
> and anything else that is serialized. I don't think the two uses coincide.
> You'll have to hijack something else.

Well, in the spirit of sleaze^H^H^H^H^H^Hcompromise, how about:

   Every class that contains any final field is initialization safe
     (i.e., first-publication-safe).
   Others need not be.

As mentioned before, there aren't any interesting cases where this
doesn't have the right effect in practice. When any fields are
mutable, programmers will need to lock anyway to eliminate conflicts.

-- 
Doug Lea, Computer Science Department, SUNY Oswego, Oswego, NY 13126 USA
dl@cs.oswego.edu 315-341-2688 FAX:315-341-5424 http://gee.cs.oswego.edu/  
-------------------------------
This is the JavaMemoryModel mailing list, managed by Majordomo 1.94.4.

To send a message to the list, email JavaMemoryModel@cs.umd.edu To send a request to the list, email majordomo@cs.umd.edu and put your request in the body of the message (use the request "help" for help). For more information, visit http://www.cs.umd.edu/~pugh/java/memoryModel



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