definition of data race

OpenMP 5.1 will be the next version of the OpenMP specification. This technical report is the latest draft of the 5.1 specs. Use this forum for public discussion.
Locked
sfsiegel
Posts: 12
Joined: Mon Mar 24, 2014 4:47 pm

definition of data race

Post by sfsiegel »

The definition of data race is given in Sec. 1.4.1:
If multiple threads write without synchronization to the same memory unit, including cases due to atomicity considerations as described above, then a data race occurs. Similarly, if at least one thread reads from a memory unit and at least one thread writes without synchronization to that same memory unit, including cases due to atomicity considerations as described above, then a data race occurs. If a data race occurs then the result of the program is unspecified.
My question is about the exact meaning of "without synchronization". Other standards with similar memory models use the happens-before relation to define a data race. For example, this is from the C Standard:
The execution of a program contains a data race if it contains two conflicting actions in different threads, at least one of which is not atomic, and neither happens before the other.
The OpenMP Spec also defines a happens-before relation, but the happens-before relation is not mentioned in the OpenMP definition of data race. Should the OpenMP definition of data race be similar to the C one?

Locked