LabWindows/CVI

Content Type
Programming Language
Current manual

atomic Directive

atomic Directive

Ensures that a storage location updates atomically instead of allowing multiple threads to write to it simultaneously.

Binding thread set: all threads

Format

#pragma omp atomic newline
expression statment

Example

void a16(float *x, float *y, int *index, int n)
{
   int i;
   #pragma omp parallel for shared(x, y, index, n)
      for (i=0; i<n; i++)
      {
         #pragma omp atomic
         x[index[i]] += work1(i);
         y[i] += work2(i);
      }
}

In This Section
Was this information helpful?

Previous

single

Previous

single