Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

C++ chain of tasks

I have to handle the following scenerio: I've 5 tasks("A","B","C","D","E"), I'd like to parallelize them but in respect to their dependiences. They have to be executed in such an order:

A --> B --\
C ----------> E
D --------/

So "E" is executed when all the previous ones are finished and "B" has to be executed after A. And here is my question. Are there any ready to go solutions (STL, Boost)? Or I will have to implement it basing on std::thread?

like image 257
Dejwi Avatar asked Jun 17 '13 07:06

Dejwi


1 Answers

check out TBB's Flow Graph or the PPL.

The example in the TBB link shows approximately what you have sketched. You already formulated your problem abstracted as tasks. No need to get down to the thread level at first.

like image 129
Dmitry Ledentsov Avatar answered Oct 12 '22 10:10

Dmitry Ledentsov