D2 CAS, atomic increment

Oliver Dathe o.dathe at gmx.de
Wed Apr 15 08:11:51 PDT 2009


Jason House wrote:
> I'm currently using part of the Tango D2 branch to get basic lock
> free methods. I know there's license issues with just copying Tango
> into Phobos, so does anyone have (or be able to write) these basic
> building blocks?

When I used Tango for atomic ops I ran into a couple of problems you may 
be aware of:
http://dsource.org/projects/tango/attachment/ticket/1202/atomic.d
http://dsource.org/projects/tango/ticket/1222

If it helps you can use my proposal for [1202] 
http://dsource.org/projects/tango/attachment/ticket/1202/atomic.d
under any license you wish. However it is just for most simple atomic 
arithmetic operations and uses CTFE for assembling appropriate asm code.

Recently I've used libatomic_ops from Boehm-GC in a C++ project.
http://www.hpl.hp.com/research/linux/atomic_ops/

> I'm planning on porting the lock-free (and mostly fence free) hash
> table from "high-scale-lib". It beats the pants off Java's concurrent
> hash table and scales nearly linear to hundreds of cores and
> thousands of threads. It can also handle a high write rate. I'll try
> to get it into Phobos when done.

Cool



More information about the Digitalmars-d mailing list