Boost logo

Boost :

From: Cory Nelson (phrosty_at_[hidden])
Date: 2008-04-28 17:05:55


On Mon, Apr 28, 2008 at 11:25 AM, Tim Blechmann <tim_at_[hidden]> wrote:
> hi all,
>
> i would be curious, if some people might want to work together in order
> to implement a boost-style lockfree library ...
>

I'd be interested in contributing. This seems well designed already,
but I see some improvements:

I want intrusive versions of stack/queue. The freelist could also be
made to use the stack.

The allocator should put blocks on cache-line boundaries.

A simple freelist allocator that grabs blocks in pages would be
fantastic in a lot of cases.

The algo works inefficiently on IA64 because it copies the pointer
when IA64 only needs to copy the ABA counter (it has cmp8xchg16b).
This can be reworked to have a tagged_ptr<>::cmp_type instead of
comparing with another tagged_ptr.

CAS on x86 will give you the old value if it fails. CAS should be
changed to modify the compare arg, so you can write a loop without
constantly loading the destination:

cmp_type cmp = dest;
do {
...
} while(!CAS(dest, exch, cmp));

-- 
Cory Nelson

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk