Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Intel TBB: pool of graphs

I have a data processing model which is made of many chains of algorithms processing data chunks. Each chain is a graph of algorithms, which I implemented with the TBB graph class.

Now I would like to have something like a "pool of graphs", i.e. a pool of tasks, each of them containing a tbb::graph. In this way I could run the chains of algorithms in parallel over the data chunks.

Could you point any TBB example of something similar to a "pool of graphs", or might you suggest and hints to implement it?

like image 892
rmbianchi Avatar asked Nov 13 '22 09:11

rmbianchi


1 Answers

My suggestion would be that you use tbb::concurrent_queue or tbb::concurrent_vector , the advantage of it is that you can resize it during multiple accesses. My personal hint to this, create a lock / graph object so that you never modify an object in parallel.

http://threadingbuildingblocks.org/wiki/index.php?title=Concurrent_Vector

An example for the queue can be found here: https://sites.google.com/site/samplecodesproject/tbb/containers-3/concurrent_queue

like image 155
Oliver Avatar answered Dec 20 '22 06:12

Oliver