From: Doug Lea <firstname.lastname@example.org>
>Consider the use of simple classes like String and Integer. One of the
>original motivations for declaring these classes as immutable wass for
>the sake of thread safety.
>Should there be two versions, one of which uses synch in its constructor
>and one not? Or should people put synch blocks only when constructing
>those that the believe might be accessible across threads?
It's not enough to synch the constructor! An unlock action in the writer
without a lock action in the reader is useless.
>No answers along these lines strike me as tolerable.
>I think the only choice here is for the semantics to guarantee safety.
I agree wholeheartedly.
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 email@example.com 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:13 EDT