Some data-sharing attribute clauses, including reduction clauses, specify that list items that appear in their list argument may be privatized for the construct on which they appear. Each task that references a privatized list item in any statement in the construct receives at least one new list item if the construct has one or more associated loops, and otherwise each such task receives one new list item. Each SIMD lane used in a simd construct that references a privatized list item in any statement in the construct receives at least one new list item. Language-specific attributes for new list items are derived from the corresponding original list item. Inside the construct, all references to the original list item are replaced by references to a new list item received by the task or SIMD lane.
If the construct has one or more associated loops then, within the same logical iteration of the loops, the same new list item replaces all references to the original list item. For any two logical iterations, if the references to the original list item are replaced by the same list item then the logical iterations must execute in some sequential order.
In the rest of the region, whether references are to a new list item or the original list item is unspecified. Therefore, if an attempt is made to reference the original item, its value after the region is also unspecified. If a task or a SIMD lane does not reference a privatized list item, whether the task or SIMD lane receives a new list item is unspecified.
The value and/or allocation status of the original list item will change only:
As a side effect of directives or clauses; or
The new list item is initialized, or has an undefined initial value, as if it had been locally declared without an initializer.
The order in which any default constructors for different private variables of class type are called is unspecified. The order in which any destructors for different private variables of class type are called is unspecified.
For a list item or the subobject of a list item with the ALLOCATABLE attribute:
A privatized list item may be storage-associated with other variables when the data-sharing attribute clause is encountered. Storage association may exist because of base language constructs such as EQUIVALENCE or COMMON. If A is a variable that is privatized by a construct and B is a variable that is storage-associated with A then:
A privatized list item may be a selector of an ASSOCIATE or SELECT TYPE construct. If the construct association is established prior to a parallel region, the association between the associate name and the original list item will be retained in the region.
Finalization of a list item of a finalizable type or subobjects of a list item of a finalizable type occurs at the end of the region. The order in which any final subroutines for different variables of a finalizable type are called is unspecified.
If a list item appears in both firstprivate and lastprivate clauses, the update required for the lastprivate clause occurs after all initializations for the firstprivate clause.
Restrictions
The following restrictions apply to any list item that is privatized unless otherwise stated for a given data-sharing attribute clause: