次の方法で共有


A.8 Specifying Parallel Sections

 

The new home for Visual Studio documentation is Visual Studio 2017 Documentation on docs.microsoft.com.

In the following example, (for Section 2.4.2 on page 14) functions xaxis, yaxis, and zaxis can be executed concurrently. The first section directive is optional. Note that all section directives need to appear in the lexical extent of the parallel``sections construct.

#pragma omp parallel sections  
{  
    #pragma omp section  
        xaxis();  
    #pragma omp section  
        yaxis();  
    #pragma omp section  
        zaxis();  
}