[cpp-threads] Draft Plan for Threads in C++

Lawrence.Crowl at Sun.com Lawrence.Crowl at Sun.com
Fri Apr 29 17:57:04 BST 2005


Ben Hutchings <ben at decadentplace.org.uk> writes:
 >Lawrence.Crowl at Sun.com wrote:
 >> "Boehm, Hans" <hans.boehm at hp.com> writes:
 >>  >Should it provide specific "atomic" classes like the Java one?
 >>  >Should it be a template on arbitrary types, which can just say "not
 >>  >implemented" if you ask for atomic 276 byte structs with overloaded
 >>  >assignment?  Do we agree that the operations should be (op,
 >>  >ordering_constraint) pairs?  Is the ordering_constraint a template
 >>  >parameter?  What about optional hardware-dependent functionality?
 >> 
 >> All good questions.  My current thinking is to keep it simple, e.g. a
 >> few lock objects, an atomic integer with atomic += operations, a
 >> compare-and-swap operation.
 ><snip>
 >
 >With respect, I think this is naive.  Where available, atomic += may be
 >highly constrained; for example on IA64 it can add or subtract 1, 4, 8
 >or 16.  CAS isn't universally available and on the ARM architecture it
 >probably still won't be commonly available in 2009 without OS support.
 >If I'm not mistaken, most lockless algorithms require ordering
 >constraints.

Implicitly, I was assuming that the ability to write lockless algorithms
was a goal for the work.

  Lawrence Crowl             650-786-6146   Sun Microsystems, Inc.
                   Lawrence.Crowl at Sun.com   16 Network Circle, UMPK16-303
           http://www.Crowl.org/Lawrence/   Menlo Park, California, 94025




More information about the cpp-threads mailing list