[Openmp-dev] data racing of updating global variables when there are multiple root threads each of which starts a parallel region ??

Yonghong Yan via Openmp-dev openmp-dev at lists.llvm.org
Wed Dec 21 19:00:05 PST 2016


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?

For example, for __kmp_all_nth ++ in __kmp_allocate_thread 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.

https://github.com/llvm-mirror/openmp/blob/master/
runtime/src/kmp_runtime.cpp#L4297

Yonghong
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/openmp-dev/attachments/20161221/2dd113e6/attachment.html>


More information about the Openmp-dev mailing list