C++ Logo

std-proposals

Advanced search

Re: [std-proposals] atomic_compare_exchange_and_notify

From: Thiago Macieira <thiago_at_[hidden]>
Date: Tue, 13 Jan 2026 17:30:25 -0800
On Tuesday, 13 January 2026 16:55:24 Pacific Standard Time Ryan P. Nicholl via
Std-Proposals wrote:
> Of course, it's possible to implement std::latch using things like
> SYS_futex, so this isn't impossible to implement per se, only impossible to
> implement using the C++ standard library without relying on undefined
> behavior.

How does futex make it possible while notify_one/all doesn't? Wouldn't it run
into the same issue?

If the thread doing the wait successfully set a "contended" state and entered
wait, then it won't wake up until a notification happens. Why would it destroy
the object before then?

-- 
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
  Principal Engineer - Intel Data Center - Platform & Sys. Eng.

Received on 2026-01-14 01:30:52