CriticalSection

CriticalSection[{var1, var2, ...}, expr]
locks the variables with respect to parallel computation, evaluates expr, then releases the .

DetailsDetails

  • 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.
New in 7
New to Mathematica? Find your learning path »
Have a question? Ask support »