CVS difference for ai05s/ai05-0117-1.txt

Differences between 1.7 and version 1.8
Log of other versions for file ai05s/ai05-0117-1.txt

--- ai05s/ai05-0117-1.txt	2011/01/25 07:52:10	1.7
+++ ai05s/ai05-0117-1.txt	2011/01/29 03:48:28	1.8
@@ -651,6 +651,55 @@
 
 ****************************************************************
 
+From: Florian Weimer
+Date: Sunday, August 22, 2010  12:27 PM
+
+Are barriers really that useful for practical implementations of lock-free
+algorithms?  Most examples of such algorithms I have seen use the
+compare-and-swap primitives provided by modern multiprocessors.  These
+primitives are increasingly optimized in hardware (for instance, CAS can be made
+free if the cache line is unshared under the MESI protocol).  Therefore,
+building your own CAS, starting from barriers, seems suboptimal.
+
+****************************************************************
+
+From: Randy Brukardt
+Date: Sunday, August 22, 2010   5:23 PM
+
+Could you elaborate on your question without using acronyms that not everyone
+has heard of?? (What the heck is CAS??)
+
+In any case, we've preliminarily decided that the questioner that started this
+AI started from an incorrect assumption: we do not believe that Ada has any
+requirement for memory barriers. The problem stems from a reading of the wording
+in the Standard that assumed a much simpler model of memory than is used today.
+See the recently released draft minutes of the Valencia ARG meeting.
+
+****************************************************************
+
+From: Florian Weimer
+Date: Monday, August 23, 2010  11:59 AM
+
+> Could you elaborate on your question without using acronyms that not
+> everyone has heard of?? (What the heck is CAS??)
+
+Compare-and-swap.  It's a machine instruction which replaces a word in memory if
+it has a specified value.  Comparison and replacement happen atomically, and in
+Ada's context, CAS would signal readers of the variable and other CAS users.
+
+(Compare-and-swap is mentioned in the standard, BTW.)
+
+> In any case, we've preliminarily decided that the questioner that
+> started this AI started from an incorrect assumption: we do not
+> believe that Ada has any requirement for memory barriers.
+
+It already has barriers, in the form of the signaling concept.  The main
+question is if a weaker form is necessary for performance reasons.  I don't
+program for machines which aggressively reorder memory accesses, so for me, the
+main cost of a barrier are missed compiler optimizations.
+
+****************************************************************
+
 From: Santiago Uruena Pascual
 Date: Wednesday, January 12, 2011  2:29 AM
 

Questions? Ask the ACAA Technical Agent