[Openmp-commits] [PATCH] D101082: [OpenMP] Fix deadlock for detachable task with child tasks

Andrey Churbanov via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Mon Jul 26 11:26:46 PDT 2021


AndreyChurbanov added inline comments.


================
Comment at: openmp/runtime/src/kmp_tasking.cpp:3887
   // Remove the imaginary children
-  KMP_ATOMIC_DEC(&taskdata->td_incomplete_child_tasks);
+  KMP_ATOMIC_AND(&taskdata->td_incomplete_child_tasks, !PROXY_TASK_FLAG);
 }
----------------
This statement zeroes the taskdata->td_incomplete_child_tasks.
Proper operation would be to clear the set bit only, that is 

```
KMP_ATOMIC_AND(&taskdata->td_incomplete_child_tasks, PROXY_TASK_FLAG-1);
```
Once the PROXY_TASK_FLAG is the degree of 2, minus one should fill all bits but the highest one.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D101082/new/

https://reviews.llvm.org/D101082



More information about the Openmp-commits mailing list