C++ Logo

std-proposals

Advanced search

Re: [std-proposals] atomic_compare_exchange_and_notify

From: Jonathan Wakely <cxx_at_[hidden]>
Date: Wed, 14 Jan 2026 21:52:44 +0000
On Wed, 14 Jan 2026 at 20:42, Ryan P. Nicholl <rnicholl_at_[hidden]>
wrote:

>
> Alternative: publish a DR that clarifies that "atomic_notify_*" functions
> are well defined and do not cause a race even if the object no longer
> exists at the pointed address. I think this will work for recent Windows
> STL, libc++, Glibc, and MUSL, at least for most types. I haven't checked
> other implementations.
>

What if the object has not only been destroyed, but deallocated, and the
memory is no longer part of the address space? Should it still work?

I don't see how you can start the discussion talking about what's possible
in the abstract machine, and then proceed to "and you should just be able
to perform operations on objects outside their lifetime".

Received on 2026-01-14 21:53:00