Freigeben über


OpenMP Directives

Provides links to directives used in the OpenMP API.

Visual C++ supports the following OpenMP directives:

Directive

Description

atomic

Specifies that a memory location that will be updated atomically.

barrier

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

critical

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.

master

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.

parallel

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.

single

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

threadprivate

Specifies that a variable is private to a thread.

See Also

Reference

OpenMP Clauses

Other Resources

OpenMP in Visual C++