zoukankan      html  css  js  c++  java
  • TBB Task Scheduler Notes

    * Distribute tasks in a round-robin fashion.

    * Required APIs:

    void task::spawn_root_and_wait(taks&);
    void task::spawn(task&);
    void task::spawn_and_wait_for_all(task&);

    Depth-first execution:
      * Strike when the cache is hot. The deepest tasks are the most recently created tasks, and therefore are

    hottest in cache.
      * Minimize space. Depth-first execution creates nodes linearly.

    Breadth-first execution:
      * Maximize parallelism.

    Eah thread has its own task queue. When a thread spawns a task, it pushes it onto the bottom of its queue. (top:

    oldest task, bottom: youngest task)

    A thread continually executes a task obtained by the first rule below that applies:
    1. Pop a task from the bottom of its own queue. This rule does not apply if the queue is empty. (depth-first

    execution)
    2. Steal a task from the top of another randomly chosen queue. If the chosen queue is empty, the thread tries

    this rule again until it succeeds. (breadth-first execution)

  • 相关阅读:
    [火柴排队]
    [NOI2001食物链]
    [黑科技]
    [SDOI2009HH的项链]
    [GXOI/GZOI2019旅行者]
    [Nim游戏]
    Log4Net
    C#创建windows服务并定时执行
    MySQL实现类似Oracle的序列
    DevExpress XtraTreeList的复选框 禁用
  • 原文地址:https://www.cnblogs.com/len3d/p/2558971.html
Copyright © 2011-2022 走看看