HOME
| OPENMP API Specification: "Version 5.2 -- GIT rev 95b2e3a44"

5.4.2  shared Clause

Name: shared

Properties: data-environment attribute, data-sharing attribute

Arguments

Name

Type

Properties

list

list of variable list item type

default

Directives

parallel

,

task

,

taskloop

,

teams

Semantics

The shared clause declares one or more list items to be shared by tasks generated by the construct on which it appears. All references to a list item within a task refer to the storage area of the original variable at the point the directive was encountered.

The programmer must ensure, by adding proper synchronization, that storage shared by an explicit task region does not reach the end of its lifetime before the explicit task region completes its execution.

The association status of a shared pointer becomes undefined upon entry to and exit from the construct if it is associated with a target or a subobject of a target that appears as a privatized list item in a data-sharing attribute clause on the construct. A reference to the shared storage that is associated with the dummy argument by any other task must be synchronized with the reference to the procedure to avoid possible data races.

Cross References