definition of data race
Posted: Tue May 19, 2020 9:57 am
The definition of data race is given in Sec. 1.4.1:
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: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.
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?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.