This documentation is archived and is not being maintained.

firstprivate 

Specifies that each thread should have its own instance of a variable, and that the variable should be initialized with the value of the variable, because it exists before the parallel construct.


firstprivate(var)

where,

var

The variable to have instances in each thread and that will be initialized with the value of the variable, because it exists before the parallel construct. If more than one variable is specified, separate variable names with a comma.

firstprivate applies to the following directives:

For more information, see 2.7.2.2 firstprivate.

See sections (OpenMP) for an example of using firstprivate.

Show: