|
Boost : |
Subject: Re: [boost] [lock-free] CDS -yet another lock-free library
From: Khiszinsky, Maxim (Maxim.Khiszinsky_at_[hidden])
Date: 2010-04-01 01:20:53
Tim Blechmann wrote:
> are you sure, that _mm_loadl_epi64 is actually atomic in your case?
> according to the intel manual, the value should be 64bit aligned or should
> not cross a cache line boundary. are you sure, that this cannot occur?
Yes, atomic64_t is declared as
typedef long long __declspec( align(8) ) atomic64_t ;
for x86 win32 (for x86 gcc there is similar declaration)
So, I hope it is aligned and atomic.
In additions, I check the proper alignment in calls by
assert( is_aligned<8>( pAddr )) ;
where is_aligned is:
template <int ALIGN, typename T>
static inline bool is_aligned(T const * p)
{
return (((uptr_atomic_t)p) & (ALIGN - 1)) == 0 ;
}
Regards, Max
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk