I have an exe that creates 5 tasks (let's call these tasks A tasks), push them onto a task_list and run them using spawn_root_and_wait(taskList). Before I call this I call task_scheduler_init init(25).The above tasks create more tasks (let's call these tasks B tasks) and they are pushed on to the task scheduler using tbb::task::enqueue().Here's when things get tricky, after A tasks push B tasks onto the task scheduler, they wait for the B's to finish. I implemented a wait using condition variables. Basically A's wait until B's come back and notify the condition variable.What happens in my program is my code runs all the way until A's are waiting. But B's never get executed. I put a print statement in B's execute() method and that never gets executed. So it's like 1. TBB never got the tasks or 2. TBB is waiting for some threads to finish.I want to say the reason is 2. Why? 1. I ran my code through the Intel Inspector, and it didn't spit out any warnings or errors. It just happily waits forever. 2. In the Windows Task Manager it shows only 5 threads for the exe eventhough I used task_scheduler_init with 25. So I'm guessing those 5 threads are just waiting running the A's and TBB doesn't have anymore threads to execute the B's.Is this a possible case? In Windows Task Manager as the number of threads does it show all the TBB worker threads as well?Thank you in advance.
Nähere Informationen zur Compiler-Optimierung finden Sie in unserem Optimierungshinweis.