문제

I am trying to set up an atomic vector, like

struct Vector
{
    double data[3];
};

and i wish it work atomicly in TBB. So I used

tbb::atomic<Vector> atomic_vec;

However, it failed to work, as the compiler stating tbb::internal::atomic_impl<T>::my_storage has incomplete type. I inspected tbb/atomic.h and found the relevant tbb::internal::aligned_storage<Vector, sizeof(Vector)=24ul> not specialized. Is there a way of avoiding this?

도움이 되었습니까?

해결책

tbb::atomic can be instantiated with types no greater than 64 bit as tbb::atomic designed to use "non blocking" hardware primitives. This is a limitation of vast majority of hardware TBB is intended to run on.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top