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, eliminate duplicates and send them back when other threads need them.
However, I know TBB offers concurrent_vector and concurrent_queue which can be read and written concurrently from different threads. But how to sort the objects inside a container? Does everyone know how to do that? Thanks.
concurrent_vector works with std::sort and both tbb & ppl (in the sample pack) offer parallel sorts that can be used with this. A parallel version of std::unique would be even more useful for removing dupes, but you'd have to build your own.