June 2003
Intermediate to advanced
540 pages
11h 43m
English
The threadprivate directive is provided to make file-scope, namespace-scope, or static block-scope variables local to a thread. The syntax of the threadprivate directive is as follows:
#pragma omp threadprivate(variable-list) new-line
Each copy of a threadprivate variable is initialized once, at an unspecified point in the program prior to the first reference to that copy, and in the usual manner (that is, as the master copy would be initialized in a serial execution of the program).
As with any private variable, a thread must not reference another thread’s copy of a threadprivate object. During serial regions and master regions of the program, references will be to the master thread’s copy ...
Read now
Unlock full access