locks the variables vari with respect to parallel computation, evaluates expr, then releases the vari.
- At most one instance of a critical section with the same lock variable is allowed to run concurrently on any parallel kernel.
- Variables used as locks should not have a value in the master kernel.
Basic Examples (1)
Protect a block of code from interference by other threads:
Without protecting access to the update code, subkernels may overwrite results:
Generalizations & Extensions (1)
Properties & Relations (2)