共用方式為


firstprivate

 

The new home for Visual Studio documentation is Visual Studio 2017 Documentation on docs.microsoft.com.

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.

Syntax

firstprivate
(var)  

Parameters

Parameter Description
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.

Remarks

Remarks

firstprivate applies to the following directives:

For more information, see 2.7.2.2 firstprivate.

Example

For an example of using firstprivate, see the example in private.

See Also

Clauses