Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All
Important This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here.

OpenMP Directives

Provides links to directives used in the OpenMP API.

Visual C++ supports the following OpenMP directives:




Specifies that a memory location that will be updated atomically.


Synchronizes all threads in a team; all threads pause at the barrier, until all threads execute the barrier.


Specifies that code is only executed on one thread at a time.

flush (OpenMP)

Specifies that all threads have the same view of memory for all shared objects.

for (OpenMP)

Causes the work done in a for loop inside a parallel region to be divided among threads.


Specifies that only the master threadshould execute a section of the program.

ordered (OpenMP Directives)

Specifies that code under a parallelized for loop should be executed like a sequential loop.


Defines a parallel region, which is code that will be executed by multiple threads in parallel.

sections (OpenMP)

Identifies code sections to be divided among all threads.


Lets you specify that a section of code should be executed on a single thread, not necessarily the master thread.


Specifies that a variable is private to a thread.

Community Additions

© 2015 Microsoft