C++ Logo

std-discussion

Advanced search

Re: Unsynchronized placement-new

From: language.lawyer_at <language.lawyer_at_[hidden]>
Date: Tue, 20 Dec 2022 11:47:17 +0500
>> Now, if the new expression that invokes placement-new involves
>> initialization, then yes, that does cause a data race with other
>> initializing placement-new operations on that storage. This is because
>> of the initialization operations conflicting by accessing the same
>> memory.
>
> Initialization is not considered modification, thus (and because it also is not read) it is not access.

... even if it were, data race is about the *same* memory location, and initializing different scalar objects would mean accessing *different* memory locations.

Received on 2022-12-20 06:47:23