title: Asynchronous and load dependent thread/task management with TBB
body: <p>I'm trying for first time the Intel TBB and I'm stucked right at the beginning.</p>
  
  <p>I've attached a simple image to show how I want to build my concurrency program.</p>
  
  <p><a href="https://i.stack.imgur.com/puhNm.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/puhNm.png" alt="enter image description here"></a></p>
  
  <p>I've took a look at here <a href="https://stackoverflow.com/questions/10607215/simplest-tbb-example">Simplest TBB example</a> and here <a href="https://stackoverflow.com/questions/8301827/using-tbb-for-non-parallel-tasks">using TBB for non-parallel tasks</a>.</p>
  
  <p>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.</p>
  
  <p>Thre result should be a CPU running all cores without memory overflow.</p>
  
  <p>Are there any examples?</p>