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.
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?