I'm running a small program built using TBB on Windows with mingw32. It does a parallel_for. Inside the parallel_for my object makes changes to a concurrent_hash_map object. It starts running but later throws a SIGSEGV when I try to use an accessor. I don't know where the problem is.
Foobar(FoobarParent* rw) : _rw(rw)
_fooMap = &_rw->randomWalkers();
void operator() (const tbb::blocked_range
&r ) const
for(size_t i = r.begin(); i != r.end(); ++i)
void apply(int i) const
Point3D current = a->second;
Point3D next = _rw->getNext(current);
a->second = next;
pointMap_t is defined as:
Can someone shed a light on this issue? I'm new to TBB. The signal is thrown when the apply method calls a->second.
One possible reason of the issue is that you assume that the item exists by not checking the return status of find() operation, but in reality it seems not.