multithreading - Set priority of PPL thread groups -
i have scenario functions need complete possible , given computation resources @ expense of other tasks (i.e. high-priority). specifically, graphics rendering, , tasks spawned rendering should run possible not consume full cpu capacity. simultaneously, want fill empty cycles of cpu other work not time-critical , make sure not steal cycles rendering tasks.
the basic idea simple, cannot figure out how want through ppl. have found how set default scheduler different priorities, don't want globally change priority. rather, want have 2 distinct scheduling policies can add tasks @ time.
the ideal situation if create 2 task_group instances different priorities , add tasks relevant group needed, don't see how that. linked relevant documentation found, want, uses agents in way leaves me unsure how simple action of adding task. rather not add complexity of agents , message passing if can use basic facilities in ppl.
https://msdn.microsoft.com/en-us/library/dd984038.aspx
it important can ensure sub-tasks spawned thread inherit priority of parent. specifically, call parallel_for both high , low priority tasks , parallel_for blocks should keep same priority.
the task constructor (and create_task function) can take task_options parameter custom scheduler.
Comments
Post a Comment