C++ Logo


Advanced search

Re: [std-proposals] unique_lock<atomic_flag>

From: Thiago Macieira <thiago_at_[hidden]>
Date: Wed, 22 Feb 2023 13:29:39 -0800
On Tuesday, 21 February 2023 23:17:11 PST Frederick Virchanza Gotham via Std-
Proposals wrote:
> Shortly afterward, Thiago Macieira posted:
> > That is not a good implementation. It's neither a spinlock nor a futex.
> I don't see anything wrong with waiting for an atomic to change.
> I don't see why a binary_semaphore would better than an atomic_flag here.

That's because you haven't studied the code that this generates. It's worse
than a simple mutex or binary_semaphore.

Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
   Software Architect - Intel DCAI Cloud Engineering

Received on 2023-02-22 21:29:41