Domanda

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?

È stato utile?

Soluzione

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.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top