Re: How to implement readonly property
Re: How to implement readonly property
- Subject: Re: How to implement readonly property
- From: Jean Suisse <email@hidden>
- Date: Sat, 08 Dec 2012 23:07:58 +0100
Speaking of Double-Checked Locking, there is this interesting article from Scott Meyers and Andrei Alexandrescu, written in 2004, which states:
This article explains why Singleton isn’t thread safe, how DCLP attempts to address that problem, why DCLP may fail on both uni- and multiprocessor ar-chitectures, and why you can’t (portably) do anything about it. Along the way, it clarifies the relationships among statement ordering in source code, sequence points, compiler and hardware optimizations, and the actual order of statement execution. Finally, it concludes with some suggestions regarding how to add thread-safety to Singleton (and similar constructs) such that the resulting code is both reliable and efficient.
DCLP = Double-Checked Locking Pattern
Link: http://erdani.com/publications/DDJ_Jul_Aug_2004_revised.pdf
Jean
-----------
Jean Suisse
Institut de Chimie Moléculaire de l’Université de Bourgogne
(ICMUB) — UMR 6302
U.F.R. Sciences et Techniques, Bâtiment Mirande
Aile B, bureau 413
9, avenue Alain Savary — B.P. 47870
21078 DIJON CEDEX
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden