Skip to Main Content
Intel Threading Building Blocks
book

Intel Threading Building Blocks

by James Reinders
July 2007
Intermediate to advanced content levelIntermediate to advanced
332 pages
10h 4m
English
O'Reilly Media, Inc.
Content preview from Intel Threading Building Blocks

Task Scheduler Interfaces

The scheduler employs task stealing. Each thread keeps a ready pool of tasks that are ready to run. The ready pool is structured as an array of lists of tasks, where the list for the ith element corresponds to tasks at level i in the tree. The lists are manipulated in last-in, first-out order. A task at level i spawns child tasks at level i+1.A thread pulls tasks from the deepest nonempty list in the array. If there are no nonempty lists, the thread randomly steals a task from the shallowest list of another thread. A thread also implicitly steals if it completes the last child, in which case it starts executing the task that was waiting on the children.

The task scheduler tends to strike a good balance between locality of reference, space efficiency, and parallelism. The scheduling technique is similar to that used by Cilk, a research project that implements efficient, unfair scheduling (http://supertech.csail.mit.edu/cilk).

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Intel® Xeon Phi™ Coprocessor Architecture and Tools: The Guide for Application Developers

Intel® Xeon Phi™ Coprocessor Architecture and Tools: The Guide for Application Developers

Rezaur Rahman

Publisher Resources

ISBN: 9780596514808Errata Page