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

Scheduling a timeout

derbai
Beginner
747 Views
Is it possible within tbb to schedule a task to run at a specific time, and/or potentially to tun every x seconds?
I'm ideally looking for this to trigger a tbb_pipeline to run.
If not, how might this be accomplished?
0 Kudos
1 Solution
jimdempseyatthecove
Honored Contributor III
747 Views
Quoting - derbai

I would ideally like to do processing at various times of the day.
One example of this would be to an ftp site every hour, download files, parse files etc etc

Qt and ACE offer this functionality within their schedulers, and I was hoping Tbb would do something similar.


while(WaitOneHourOrTerminate())
{
// create TBB working set
...
// distroy TBB working set
}

View solution in original post

0 Kudos
6 Replies
Alexey-Kukanov
Employee
747 Views
Quoting - derbai
Is it possible within tbb to schedule a task to run at a specific time, and/or potentially to tun every x seconds?
I'm ideally looking for this to trigger a tbb_pipeline to run.
If not, how might this be accomplished?

No there is no way to control behavior of TBB tasks like you described.

What exactly do you try to achieve? I.e. why starting pipelines run at specified times?
0 Kudos
pvonkaenel
New Contributor III
747 Views

No there is no way to control behavior of TBB tasks like you described.

What exactly do you try to achieve? I.e. why starting pipelines run at specified times?

I guess one approach could be to create a standard thread using the tbb::tbb_thread class. You could have it wake up on whatever your schedule is and kick off a bunch of tasks or a pipeline.

Peter
0 Kudos
derbai
Beginner
747 Views

No there is no way to control behavior of TBB tasks like you described.

What exactly do you try to achieve? I.e. why starting pipelines run at specified times?

I would ideally like to do processing at various times of the day.
One example of this would be to an ftp site every hour, download files, parse files etc etc

Qt and ACE offer this functionality within their schedulers, and I was hoping Tbb would do something similar.

0 Kudos
Alexey-Kukanov
Employee
747 Views
Quoting - derbai
I would ideally like to do processing at various times of the day.
One example of this would be to an ftp site every hour, download files, parse files etc etc

Qt and ACE offer this functionality within their schedulers, and I was hoping Tbb would do something similar.


No TBB does not have such a functionality, sorry. TBB is not a general-purpose framework but a computational parallelism oriented library. I guess you might be able to combine it with general purpose frameworks though, using it at levels when you would benefit from parallel computation on multicore systems.
0 Kudos
robert_jay_gould
Beginner
747 Views
Quoting - pvonkaenel

I guess one approach could be to create a standard thread using the tbb::tbb_thread class. You could have it wake up on whatever your schedule is and kick off a bunch of tasks or a pipeline.

Peter

I second this approach, it's easy and does the job without adding dependencies.
0 Kudos
jimdempseyatthecove
Honored Contributor III
748 Views
Quoting - derbai

I would ideally like to do processing at various times of the day.
One example of this would be to an ftp site every hour, download files, parse files etc etc

Qt and ACE offer this functionality within their schedulers, and I was hoping Tbb would do something similar.


while(WaitOneHourOrTerminate())
{
// create TBB working set
...
// distroy TBB working set
}
0 Kudos
Reply