1

I'm trying for first time the Intel TBB and I'm stucked right at the beginning.

I've attached a simple image to show how I want to build my concurrency program.

enter image description here

I've took a look at here Simplest TBB example and here using TBB for non-parallel tasks.

TBB is nice but I don't know how to handle following problem: How can I define threadpools/taskpools which are started or stopped in dependency of memory consumption. To be precise, if memory-consumption of some dataclass is too much, its filling threadpool shall be stalled (e.g. no new spawns until the other threads have consumed the data inside coresspondig dataclass.

Thre result should be a CPU running all cores without memory overflow.

Are there any examples?

Community
  • 1
  • 1
user1587451
  • 978
  • 3
  • 15
  • 30
  • I don't know of TBB examples for that. However, the TBB documentation has 3 examples of custom schedulers that tackle different problems, but you might be able to apply the fundamental tricks they use to your own problem. See: * https://www.threadingbuildingblocks.org/docs/help/hh_goto.htm#tbb_userguide/Design_Patterns/GUI_Thread.htm * https://www.threadingbuildingblocks.org/docs/help/hh_goto.htm#tbb_userguide/Design_Patterns/Non-Preemptive_Priorities.htm * https://www.threadingbuildingblocks.org/docs/help/index.htm#tbb_userguide/Design_Patterns/Non-Preemptive_Priorities.htm – Arch D. Robison Feb 01 '16 at 15:35

0 Answers0