Example: Atomic Directive
optimization of mutual exclusion for certain cases:
- the directives applies to the statement immediately following it
- the statement must not be a structured block:
- x = x op expr
- x = intrinsic(x,expr)
- x binop = expr;
- x++; x--; ++x; --x
- All references to storage x must be of the same type
-
- enables fast implementation on some hardware, others will use the critical section construct
Y(INDEX(I)) = Y(INDEX(I)) + Z