tasks-openmp
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revision | |||
| tasks-openmp [June 11, 2026 at 11:07] – Ivan Janevski | tasks-openmp [June 13, 2026 at 03:13] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| # Tasks (OpenMP) | # Tasks (OpenMP) | ||
| - | **Tasks** are the OpenMP mechanism for irregular parallelism. `parallel for` only handles loops with a known iteration count. | + | **Tasks** are the OpenMP mechanism for irregular parallelism. `parallel for` only handles loops with a known iteration count. For work like recursive algorithms, tree traversals, and producer-consumer patterns, `#pragma omp task` packages a unit of work that any idle thread in the current team can pick up and execute. Tasks are created inside a `single` region so only one thread generates them while the rest execute them. |
| - | + | ||
| - | For work like recursive algorithms, tree traversals, and producer-consumer patterns, `#pragma omp task` packages a unit of work that any idle thread in the current team can pick up and execute. Tasks are created inside a `single` region so only one thread generates them while the rest execute them. | + | |
| ```c | ```c | ||
tasks-openmp.1781176047.txt.gz · Last modified: by Ivan Janevski
