data race in flush_nolist.1.c?

Discuss the OpenMP Examples document, updated for OpenMP 4.5
Forum rules
The OpenMP Forums are now closed to new posts. Please visit Stack Overflow if you are in need of help: https://stackoverflow.com/questions/tagged/openmp
Locked
sfsiegel
Posts: 12
Joined: Mon Mar 24, 2014 4:47 pm

data race in flush_nolist.1.c?

Post by sfsiegel »

In flush_nolist.1c, isn't there a data race in function f1 on “*q=1” ?
This can be executed by all threads concurrently, and in all threads, q points to the shared variable j.
Also, a thread could be executing "sum += j" in function g while another thread is executing "*q=1" --- isn't that also a possible read-write data race?

Locked