在依赖项解析中获取并行项


Answers:


16

我假设边意味着u必须在v之前执行。如果不是这种情况,请绕过所有边缘。此外,我假设您对路径(DAG已经给出了路径)的兴趣不如对给定依赖性的良好执行策略感兴趣。üvüv

小号一世G=VË

小号0={vVüVüvË}小号一世+1个={vVüVüvËüķ=0一世小号ķ}

ķ

for i=0 to k
  parallel foreach T in S_k
    execute T

小号0

parallel foreach T in S_0
  recursive_execute T

哪里

recursive_execute T {
  atomic { if T.count++ < T.indeg then return }
  execute T
  parallel foreach T' in T.succ
    recursive_execute T'
}

并且T.count是一个简单的配对保持前辈的数量T已经已经执行,T.indegpredeccessors的数量和T.succ设置的接班人。

By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.