C++ Logo

std-discussion

Advanced search

Re: Data races

From: Jason McKesson <jmckesson_at_[hidden]>
Date: Mon, 6 Mar 2023 17:30:20 -0500
On Mon, Mar 6, 2023 at 3:40 PM Vladimir Grigoriev via Std-Discussion
<std-discussion_at_[hidden]> wrote:
>
> In the paragraph #15 of section 6.9.2.2 Data races of the C++20 Standard there is written
>
> «15 If an operation A that modifies an atomic object M happens before an operation B that modifies M, then A shall be earlier than B in the modification order of M.»
>
> Is not it just a tautology?

That's only because you're assuming what "happens before" means based
on the literal words. Previously, the standard explained under what
circumstances "happens before" takes place. This sentence explains
what "happens before" actually *does*.

Until this sentence, the atomic "modification order" has been a
concept wholly separate from "happens before". This sentence connects
them.

Received on 2023-03-06 22:31:35