Intel® C++ Compiler 16.0 User and Reference Guide

Introduction to Holders

A holder is a hyperobject that isolates parallel uses of a common variable in cases where it is not necessary to preserve changes from different parallel strands. Each parallel strand will see and manipulate a different view of the holder, just as in the case of a reducer.

A holder is similar to thread-local storage but is specifically designed to work with the fork-join structure of Intel® Cilk™ Plus.

A holder has the following characteristics:

A holder can be used as an alternative to parameter passing because it can replace non-local variables without massive refactoring. A holder takes advantage of the fact that, most of the time, a holder view does not change after a spawn or from one iteration of a parallel for loop to the next (stealing is the exception). When the holder view is a large object that is expensive to construct, this optimization can save significant time by avoiding the creation of a separate local object for each view.

In addition, a holder using the "keep last" policy has the same value after a sync as the serialization of the same program. This characteristic often allows the program to avoid recomputing a value.