diff options
author | Jonathan Peyton <jonathan.l.peyton@intel.com> | 2019-04-04 20:35:29 +0000 |
---|---|---|
committer | Jonathan Peyton <jonathan.l.peyton@intel.com> | 2019-04-04 20:35:29 +0000 |
commit | b727d384a3ad0fe9ac1901e6da54c593b2c1a491 (patch) | |
tree | 984f0c9ee1942a6a1cd1d0bf68721ce1169734f7 /clang/lib/Basic/SourceManager.cpp | |
parent | 19d21854e92ed3acdeee17a6c2dd106f9e9dd058 (diff) | |
download | llvm-b727d384a3ad0fe9ac1901e6da54c593b2c1a491.zip llvm-b727d384a3ad0fe9ac1901e6da54c593b2c1a491.tar.gz llvm-b727d384a3ad0fe9ac1901e6da54c593b2c1a491.tar.bz2 |
[OpenMP] Fix hang on Windows
Debug dump on large machine shows when many OpenMP threads (401 in total)
sleep on a barrier, one of the innermost nesting levels sleeps
on a child's b_arrived flag whose value is equal to 4 and is equal to
checker value. i.e., (1) sleep bit is 0, and (2) done_check() would
return true if called.
It is unclear how this might happen. It could be Windows Server 2016's
error of EnterCriticalSection / LeaveCriticalSection, or
error of WaitForSingleObject / SetEvent / ResetEvent, or
error in the library which is very difficult to find.
As a workaround, change INFINITE wait to timed wait, so that each
thread awakens each 5 seconds (the timeout was chosen arbitrary to not
disturb other threads much), check flag condition under the lock, and
either go to sleep again or stop sleeping as a result of the check.
Patch by Andrey Churbanov
Differential Revision: https://reviews.llvm.org/D59793
llvm-svn: 357722
Diffstat (limited to 'clang/lib/Basic/SourceManager.cpp')
0 files changed, 0 insertions, 0 deletions