this question is similar to How to get return value from a function called which executes in another thread in TBB? but I am working with tasks.
I have the following code:
vector<vector<int> > all;
for(h=0; h<100;h++){
vector<int> vector1= Node(anotherVector[h], value - 1, anotherVector[h].size());
for (unsigned int u = 0; u < vector1.size(); u++) {
all[h].push_back(vector1[u]);
}
}
"vector1" saves the result of the recursive call from Node. I want TBB to call the Node parallel. And then to use "vector1" to push it to "all". My problem is that if I am trying to use tasks, I need to return a Task object from Node in order to use spawn_and_wait_for_all(taskobjectlist here).
Thanks in advance for any help.