There's actually a fair bit of information available on this topic.
Java has some problems in some areas related to synchronization and
multi-threaded execution. Doug Lea, author of "Concurrent Programming
in Java" has developed a lot of this material. I'll admit to not being
expert, but interested in the topic.

Some references:

Concurrent / Thread
-----------------------------------------------------------------------------------------
Java memory model
http://www.cs.umd.edu/~pugh/java/memoryModel/
http://jcp.org/jsr/detail/133.jsp
--
JSR 133 - Java Memory Model and Thread Specification Revision, Expert
Group Formed June, 2001
http://www.jcp.org/jsr/detail/133.jsp
Reading the request in interesting.
--
Lazy instantiation
http://www.javaworld.com/javaworld/javatips/jw-javatip67.html
--
Overview of package util.concurrent Release 1.3.0 - Doug Lea
http://gee.cs.oswego.edu/dl/classes/EDU/oswego/cs/dl/util/concurrent/intro.html
--
The "Double-Checked Locking is Broken" Declaration (same link as
Stefan's)
http://www.cs.umd.edu/~pugh/java/memoryModel/DoubleCheckedLocking.html
Descriptions of double-check idiom
  Reality Check, Douglas C. Schmidt, C++ Report, SIGS, Vol. 8, No. 3,
March 1996.
  http://www.cs.wustl.edu/~schmidt/editorial-3.html
  Double-Checked Locking: An Optimization Pattern for Efficiently
Initializing and Accessing Thread-safe Objects, Douglas Schmidt and
Tim Harrison. 3rd annual Pattern Languages of Program Design
conference, 1996
  http://www.cs.wustl.edu/~schmidt/DC-Locking.ps.gz
  Lazy instantiation, Philip Bishop and Nigel Warren, JavaWorld
Magazine
  http://www.javaworld.com/javaworld/javatips/jw-javatip67.html
  Programming Java threads in the real world, Part 7, Allen Holub,
Javaworld Magazine, April 1999.
  http://www.javaworld.com/javaworld/jw-04-1999/jw-04-toolbox-3.html
  Book - Java 2 Performance and Idiom Guide, Craig Larman and Rhett
Guthrie, p100.
  http://www.javaworld.com/javaworld/jw-04-1999/jw-04-toolbox-3.html
  Book - Java in Practice: Design Styles and Idioms for Effective
Java, Nigel Warren and Philip Bishop, p142.
  http://www.google.com/search?q=Java+Design+Styles+Nigel+Bishop
  Book - Rule 99, The Elements of Java Style, Allan Vermeulen, Scott
Ambler, Greg Bumgardner, Eldon Metz, Trvor Misfeldt, Jim Shur, Patrick
Thompson, SIGS Reference library
  http://www.ambysoft.com/elementsJavaStyle.html
  Global Variables in Java with the Singleton Pattern, Wiebe de Jong,
Gamelan
  http://gamelan.earthweb.com/journal/techfocus/022300_singleton.html

P.S. Sorry about the volume



                                                                                       
                                   
                    Stefan Wachter                                                     
                                   
                    <struts.stefan.wacht        To:     [EMAIL PROTECTED]  
                                   
                    [EMAIL PROTECTED]>                  cc:                                    
                                   
                                                Subject:     Error: 
Fast-Collection-Classes do not work                   
                    12/17/2001 10:25 AM                                                
                                   
                    Please respond to                                                  
                                   
                    "Struts Developers                                                 
                                   
                    List"                                                              
                                   
                                                                                       
                                   
                                                                                       
                                   


Hi everybody!

The fast collection classes in the struts framework use a simple
strategy to
avoid (expensive?) synchronization. If a collection is to be modified
then
first clone it, then modify the clone and finally replace the original
with
the modified clone.

The problem is that the execution order of the commands is not
guaranteed. A
compiler can decide to first create the clone, then replace the
original
with the clone and then modify the original/clone -> bang.

The following article explains the problem more detailed:
http://www.cs.umd.edu/~pugh/java/memoryModel/DoubleCheckedLocking.html

--Stefan

--
GMX - Die Kommunikationsplattform im Internet.
http://www.gmx.net


--
To unsubscribe, e-mail:   <
mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <
mailto:[EMAIL PROTECTED]>






--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to