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

Should TBB be used for this problem?

supandey
Beginner
352 Views

I have read the O'Reilly TBB book and think I dont understand it fully yet as I'm not sure if I can translate my present thread based solution to tbb's task based solution.

I have an input stream of "event" data which is used by2 threads. At present I use a polling mechanism to react to this data. The 1st thread wakes up each 10 milli-second and grabs the latest event, if there is one,to process it. The 2nd thread wakes up each 10 seconds and does some diagnostics on the data stream (ie if there has been no data in 10 seconds it reports on error). I have a 3rd thread which looks at the output of the 1st two threads every few seconds and runs its own diagnostics.

I feel I should be able to make my 3 threads into 3 tasks and get rid of polling but and not sure which route to go down. Pipeline's, parallel_for,....

Thanks,
Sanjeev

0 Kudos
1 Reply
RafSchietekat
Valued Contributor III
352 Views
There is no built-in support yet for scheduling work at a particular time or periodically, but with proper care TBB can still be used to exploit any intra-event or inter-event parallelism (otherwise you might as well leave things as they are).
0 Kudos
Reply