C++ Logo

std-proposals

Advanced search

Re: [std-proposals] unique_lock<atomic_flag>

From: Frederick Virchanza Gotham <cauldwell.thomas_at_[hidden]>
Date: Wed, 22 Feb 2023 23:13:14 +0000
On Wed, Feb 22, 2023 at 9:29 PM Thiago Macieira via Std-Proposals
<std-proposals_at_[hidden]> wrote:
>
> > 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.


You can see the x86 assembler here on GodBolt:

    https://godbolt.org/z/aMva5qns7

Could you please show me how you'd use a binary_semaphore to do the
same job? I have an idea already of what you'd do but I just want to
see how you'd do it.

Received on 2023-02-22 23:13:26