LabWindows/CVI

Table of Contents
  • LabWindows/CVI Fundamentals
  • Creating Applications
  • Distributing Applications
  • Library Reference
  • Programmer Reference
  • Hardware Information

parallel sections Directive

Specifies a parallel region containing one sections directive. The parallel sections directive is a shortcut for the parallel directive followed immediately by a sections directive. The shortcut creates a team of threads and divides the sections between the threads at the same time.

Binding thread set: encountering thread

Format

#pragma omp parallel sections [clause[ [,]clause] ..] newline
   {
      #pragma omp section
      {
         code block
      }
   }

Example

int main()
{
   #pragma omp parallel sections
      {
         #pragma omp section
         printf("This is from thread %d\n", omp_get_thread_num());
         #pragma omp section
         printf("This is from thread %d\n", omp_get_thread_num());
      }
}

Log in to get a better experience