multithreading - Multiple pre-emptive thread pools in TBB -


we have requirement create number of real time processing chains 1 running @ n hz , others running @ x, y , z hz in single process. x, y , z multiple (not simple multiple) of n. example 1 chain running @ 1hz , others running @ 3hz , 4hz. each processing chain needs make use of tbb parallelize of computations etc. , needs have pool of tbb worker threads match number of hardware processors, higher frequency chains need pre-empt lower frequency chains in order system work. how can achieved using tbb?

it seems documentation not possible create competing pools of tbb workers pre-empt each other, since tbbs task groups etc. seem share single pool of real threads , there not appear anyway set real system priority of tbb worker thread, or missing something?

first, tbb not designed real-time systems. though, requirement of few hz looks relaxed quite enough.

second, tbb not designed serve thread pool. suggests user-level non-preemptive task scheduler instead of preemptive threads scheduling on os-level. tbb supposes tasks finite , small enough provide points scheduler can switch between them more efficiently os can switch execution contexts of threads. except special cases, not make sense request more worker threads hw provides (i.e. oversubscribe) , thread-level priorities not make sense either tbb.

though if not convinced arguments above , want try design, there way using 2 community-preview features: task_arena work isolation , task_scheduler_observer extensions assign system priorities worker thread entering arena.

tbb task priority feature looks more native approach tbb described requirements. though, limited 3 levels of priorities, priority of task_group_context can changed dynamically can used reorder tasks on fly.


Comments

Popular posts from this blog

android - Get AccessToken using signpost OAuth without opening a browser (Two legged Oauth) -

org.mockito.exceptions.misusing.InvalidUseOfMatchersException: mockito -

google shop client API returns 400 bad request error while adding an item -