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

Joachim Protze via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Tue Jul 27 07:25:30 PDT 2021


protze.joachim marked an inline comment as done.
protze.joachim 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);
 }
----------------
AndreyChurbanov wrote:
> 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.
Good catch. This might explain the issues I saw with this patch.

I intended to make this `~PROXY_TASK_FLAG` confused logical and bit-wise not.


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

https://reviews.llvm.org/D101082



More information about the Openmp-commits mailing list