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

Range Concept — Requirements for a type representing a recursively divisible set of values. Table 3-2 lists the requirements for a Range type R.

Description

Table 3-2. Range Concept

Pseudosignature

Semantics

R::R( const R& )

Copy constructor

R::~R()

Destructor

bool R::empty() const

True if range is empty

bool R::is_divisible() const

True if range can be partitioned into two subranges

R::R( R& r, split )

Split r into two subranges

Description

A Range can be recursively subdivided into two parts. It is recommended that the division be into nearly equal parts, but it is not required. Splitting as evenly as possible typically yields the best parallelism. Ideally, a range is recursively splittable until the parts represent portions of work that are more efficient to execute serially rather than split further. This key limit to splitting is called the grain size. The amount of work represented by a Range typically depends upon higher-level context; hence, a typical type that models a Range should provide a way to control the degree of splitting. For example, the template class blocked_ range has a grainsize parameter that specifies the biggest range considered indivisible.

The constructor that implements splitting is called a splitting constructor. If the set of values has a sense of direction, by convention the splitting constructor should construct the second part of the range and update the argument to refer to the first part of the range. Following this convention ...

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