Problem: We are trying to use the tbb::task_scheduler_observe class extensions (preview feature) to pin a couple of worker threads to a specific tbb::task_arena after changing the affinity and priority of those specific worker threads entering this dedicated real time arena. The mechanism works well as long as we are not changing the worker threads trapped into the arena to real time priority. When changing the worker threads priority to real time to solve our latency issue (note that we only do so for the couple of worker threads trapped into that specific real time arena), this makes the system freezes. I presume that the system freezes because those worker threads now at real time priority are constantly trying to leave the arena via the tbb::task_scheduler_observe::on_scheduler_leaving() where we always return false as per the sample code.
Question: Is there a way to have worker threads dedicated to a specific arena so that they are trapped and can never leave the arena without them trying to leave the arena all the time? Like Jesse Pinkman in Breaking Bad.
Actual problem we are trying to solve here: We are currently optimizing the performances of our application to have outstanding real time playback. We are already leveraging the Intel Threading Building blocks in various parts of the application. But in this particular case, we have a latency performance issue that cannot be solved by the priority scheme associated with the task_group_context. We need a couple of dedicated worker threads set at real time priority otherwise they compete with numerous other threads in the background that are working on what is going to be displayed in the future - decoding threads, processing threads, etc. In that specific scenario, the future can wait. Those dedicated worker threads don't have much to do but they have to react fast otherwise the playback could possibly drop a frame. Something we don't want. We are running on high performance dual socket workstations. We have the power. It is the low latency we need.
Many thanks in advance,