[Openmp-commits] [PATCH] D106572: [OpenMP] Refined the logic to give a regular task from a hidden helper task
Shilei Tian via Phabricator via Openmp-commits
openmp-commits at lists.llvm.org
Thu Jul 22 16:24:44 PDT 2021
tianshilei1992 added inline comments.
================
Comment at: openmp/runtime/src/kmp_taskdeps.h:150
+ successor->dn.task,
+ __kmp_tid_from_gtid(next_taskdata->encountering_gtid));
} else {
----------------
AndreyChurbanov wrote:
> tianshilei1992 wrote:
> > I found an interesting thing. If the encountering tid is not passed as a start point, the start point will be 0. In this case, it can happen that thread 0 tries to steal from thread 1, meanwhile thread 1 tries to steal from thread 0. Dead lock. @AndreyChurbanov Is it expected?
> Stealing from different queues cannot deadlock because each queue uses its own lock while stealing from it or putting a task into it.
Yeah, what I thought is not right. In fact, it is dead lock because all regular threads are waiting for the lock of a task queue (actually it is the thread with gtid 1 (tid 1), whom all tasks are given to), but all helper threads have already done their jobs.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D106572/new/
https://reviews.llvm.org/D106572
More information about the Openmp-commits
mailing list