Hi Tanguy,

> Your proposed solution looks like a variant of the Double Checked
> Locking. Unfortunately, this design pattern is very subtly broken and
> not thread safe. See
> http://www.aristeia.com/Papers/DDJ_Jul_Aug_2004_revised.pdf for more
> information.

It depends what you want to make thread safe. If the call to
'getSingletonGlExtensionDisable' should be thread safe, than
you're right. If it's enough to make the call to 'getenv'
thread safe, than the solution should be alright.
 

Greetings,
Daniel

-- 
                                                                                
                                                           
 Daniel Trstenjak         Tel   : +49 (0)7071-9457-264
 science + computing ag   FAX   : +49 (0)7071-9457-511
 Hagellocher Weg 73       mailto: [email protected]
 D-72070 Tübingen         WWW   : http://www.science-computing.de/              
                                                        
-- 
Vorstand/Board of Management:
Dr. Bernd Finkbeiner, Dr. Roland Niemeier, 
Dr. Arno Steitz, Dr. Ingrid Zech
Vorsitzender des Aufsichtsrats/
Chairman of the Supervisory Board:
Michel Lepert
Sitz/Registered Office: Tuebingen
Registergericht/Registration Court: Stuttgart
Registernummer/Commercial Register No.: HRB 382196 


_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to