Intel® Advisor User Guide

ID 766448
Date 7/13/2023
Public

A newer version of this document is available. Customers should click here to go to the newest version.

Document Table of Contents

Add OpenMP Code to Synchronize the Shared Resources

OpenMP provides several forms of synchronization:

  • A critical section prevents multiple threads from accessing the critical section's code at the same time, thus only one active thread can update the data referenced by the code. A critical section may consist of one or more statements. To implement a critical section:

    • With C/C++: #pragma omp critical

    • With Fortran: