Skip to content

Commit

Permalink
Add more comments, remove redundant whitespace
Browse files Browse the repository at this point in the history
Signed-off-by: Isaev, Ilya <[email protected]>
  • Loading branch information
isaevil committed Dec 3, 2024
1 parent c448e63 commit 0212e53
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion rfcs/proposed/parallel_block_for_task_arena/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -214,17 +214,22 @@ void parallel_phase_example() {
void scoped_parallel_phase_example() {
tbb::task_arena ta{/*arena constraints*/};
{
// Start of the parallel phase
tbb::task_arena::scoped_parallel_phase phase{ta, /*with_fast_leave=*/true};
ta.execute([]() {
// Parallel computation
});
// Serial computation
// Serial computation
ta.execute([]() {
// Parallel computation
});
} // End of the parallel phase
// Different parallel runtime (for example, OpenMP) is used
// so it is preferred that worker threads won't be retained
// in the arena at this point.
#pragma omp parallel for
for (int i = 0; i < work_size; ++i) {
// Computation
Expand Down

0 comments on commit 0212e53

Please sign in to comment.