<div dir="ltr"><div>How the runtime guard from data racing when update those global variables if there are multiple root threads (user threads) each starts a parallel region?</div><div><br></div><div>For example, for <span style="background-color:rgb(248,238,199);color:rgb(51,51,51);font-family:consolas,"liberation mono",menlo,courier,monospace;font-size:12px;white-space:pre">__kmp_all_nth ++</span> in <span style="color:rgb(0,134,179);font-family:consolas,"liberation mono",menlo,courier,monospace;font-size:12px;white-space:pre">__kmp_allocate_thread </span>which is called with a forkjoin region as indicated from the function comments. Is this forkjoin region per root thread? if so it seems data racing of updating the global variables. If there is global protection of updating the global variables, it seems a bottleneck for performance. I guess there could be other functions that are in the similar situations. </div><div><br></div><a href="https://github.com/llvm-mirror/openmp/blob/master/runtime/src/kmp_runtime.cpp#L4297" target="_blank">https://github.com/llvm-<wbr>mirror/openmp/blob/master/<wbr>runtime/src/kmp_runtime.cpp#<wbr>L4297</a><div><br></div><div>Yonghong</div></div>