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

Name

task_scheduler_init Class — Class that represents thread’s interest in task scheduling services.

Synopsis

#include "tbb/task_soinit;

Description

A task_scheduler_init is either active or inactive. Each thread that uses a task should have one active task_scheduler_init object that stays active over the duration that the thread uses task objects. A thread may have more than one active task_scheduler_init at any given moment.

The default constructor for a task_scheduler_init activates it, and the destructor deactivates it. To defer initialization, pass the value task_scheduler_init::deferred to the constructor. Such a task_scheduler_init may be initialized later by calling the initialize method. Destruction of an initialized task_scheduler_init implicitly deactivates it. To deactivate it earlier, call the terminate method.

An optional parameter to the constructor and initialize method allows you to specify the number of threads to be used for task execution. This parameter is useful for scaling studies during development, but should not be set for production use.

To minimize time overhead, it is best to have a thread create a single task_scheduler_init object whose activation spans all uses of the library’s task scheduler. A task_scheduler_ init is not assignable or copy-constructible.

Warning

The template algorithms implicitly use the task class. Hence, creating a task_scheduler_init object is a prerequisite to using the template algorithms. The debug version of the library will report ...

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