Open
Description
I have concurrent code that looks like
tbb::concurrent_vector<tbb::concurrent_vector<int>> vec;
...
// in parallel
vec.grow_to_at_least(x + 1);
vec[x].push_back(i);
It's using tbb
from libtbb-dev/testing,now 2020.1-2 amd64 [installed]
and I'm linking tbbmalloc .
This code periodically segfaults on the push_back
as if the grow has returned before indices up to x
have been constructed–presumably there's a race with a concurrent grow_to_at_least
.
Is this a user error on my part with the grow_to_at_least
interface? If so, is there an idiomatic way to concurrently grow such a vector.