Questions tagged [concurrent-vector]

concurrent_vector is a random-access sequence container which supports thread-safe dynamic growth without invalidating existing iterators and references to its elements

concurrent_vector is a random-access sequence container which supports thread-safe dynamic growth without invalidating existing iterators and references to its elements

concurrent_vector is implemented in and libraries ().

References

11 questions
16
votes
2 answers

Is there a lock-free vector implementation?

First result in Google for "lock free vector" is a research paper cowritten by Damian Dechev, Peter Pirkelbauer and Bjarne Stroustrup describing a theoretical lock-free vector. Has this, or any other lock-free vector, been implemented?
qdii
  • 12,505
  • 10
  • 59
  • 116
11
votes
1 answer

Is it concurrency-safe to call concurrency::concurrent_vector::push_back while iterating over that concurrent_vector in other thread?

push_back, begin, end are described as concurrent safe in https://learn.microsoft.com/en-us/cpp/parallel/concrt/reference/concurrent-vector-class?view=vs-2019#push_back However the below code is asserting. Probably because element is added but not…
pidgun
  • 113
  • 6
6
votes
2 answers

concurrent_vector for 2d array

I am currently trying to represent a 2D array using tbb::concurrent_vector. This 2d array will be accessed by a lot of different threads and thats why I want it to handle parallel accesses the most efficiently possible. I came up with 2…
3
votes
2 answers

concurrent_vector invalid data

using : VC++ 2013 concurrency::concurrent_vector dtnodelst Occasionally when I do dtnodelst->at(i) .... I am getting an invalid address (0XCDCD.. ofc) which shouldn't be the case cause after I do push back, I never delete or remove any…
2
votes
1 answer

concurrent_vector vs vector with mutex, thread issues with push_back

I have an object that is being processed on by multiple tasks. I copy this object multiple times and store in a vector for a task to retrieve it's own copy to work on in a parallel_for loop. Below is the code with a standard vector. The idea is I…
2
votes
1 answer

Concatenate tbb concurrent_vectors?

I have multiple large Intel TBB concurrent_vectors that I need to combine. They are so large that allocating a new concurrent_vector of adequate size is not possible. ...so the following pseudo-code won't work concurrent_vector
shao.lo
  • 4,387
  • 2
  • 33
  • 47
1
vote
1 answer

tbb::concurrent_vector returns wrong size

I've asked this question on a TBB forum, but I'm hoping someone here might have some additional thoughts. I was debugging an issue we're seeing and noticed some strange behavior from tbb::concurrent_vector. The bottom line is that after a…
JaredC
  • 5,150
  • 1
  • 20
  • 45
1
vote
3 answers

How to sort TBB concurrent_vector or concurrent_queue?

Now I have a solver in that I need to keep a set of self-defined data type objects in a concurrent_vector or queue. It has to be concurrent because the objects come from different threads.With this concurrent container, I hope to sort these objects,…
Jackie
  • 1,071
  • 2
  • 12
  • 17
0
votes
1 answer

microsoft PPL library: concurrent_vector push_back data only once

I have a Concurrency::concurrent_vector and want to push_back thread safe a new element only in case it not already exists (that's why I have to perform a search first). How can I accomplish this ? I need a concurrent collection that it's thread…
Ghita
  • 4,465
  • 4
  • 42
  • 69
0
votes
1 answer

Undefined reference to tbb::internal::concurrent_vector_base

I'm trying to learn how tbb::concurrent_vector works. I'm using ubuntu 20.04 LTS. I have installed it through ubuntu package. sudo apt-get update -y sudo apt-get install -y libtbb-dev when I try to compile this simple C++ program #include…
0
votes
1 answer

tbb - concurrent_vector address to memory?

I'm trying to get a reference to the memory of a concurrent_vector in TBB (Threaded Building Blocks) in a way similar to std::vector. So an std::vector would be accessed like: &stdVector[0]. But the equivalent for a concurrent_vector doesn't work:…
user1043761
  • 696
  • 6
  • 22