Intel® oneAPI Threading Building Blocks
Ask questions and share information about adding parallelism to your applications when using this threading library.

OneTBB: Scheduling a task for future execution

mlr11
Beginner
893 Views

Hi,

 

I am porting an application to try to take advantage of some of the TBB features.  Still somewhat new to TBB but excited about what it can do for me.

 

I have a set of tasks that I need to execute and can't proceed until they have all completed.

I currently use a task_group for that and it is working as expected (much faster than my original code).  

 

The execution of those tasks ends up creating new tasks to be executed but they can't be executed until the 1st set is 100% done.  At any point in times that can be many thousands of tasks to be executed in a single group and this process can be repeated for millions of times (task creating tasks).

 

Is there a way to queue a task without having it execute until my application is ready for it (the previous set of tasks is done)?

 

My application is similar to a pipeline with an unknown number of stages (determined at runtime and will likely always be in the millions).

 

Any ideas on how I could proceed?

 

Thanks!

0 Kudos
4 Replies
NoorjahanSk_Intel
Moderator
864 Views

Hi,


Thanks for reaching out to us.


You can try using the task::enqueue function to queue a task. You can also provide priority with this function to tasks.


Please refer to ProTBB Textbook: page No: 377


Thanks & Regards,

Noorjahan.


0 Kudos
NoorjahanSk_Intel
Moderator
806 Views

Hi,


We haven't heard back from you. Could you please provide an update on your issue?


Thanks & Regards,

Noorjahan.


0 Kudos
NoorjahanSk_Intel
Moderator
751 Views

Hi,


I have not heard back from you, so I will close this inquiry now. If you need further assistance, please post a new question.


Thanks & Regards,

Noorjahan.


0 Kudos
mlr11
Beginner
744 Views

Sorry.   I was out of town for the past 2 weeks.

 

I thought that task:enqueue is now obsolete.  Did I miss something?

 

I find the ProTBB book misguiding since it is written for the older version of TBB.

 

 

 

0 Kudos
Reply