C++ Logo

std-proposals

Advanced search

Re: Slim mutexes and locks based on C++20 std::atomic::wait

From: Thiago Macieira <thiago_at_[hidden]>
Date: Mon, 30 Aug 2021 11:41:22 -0700
On Monday, 30 August 2021 11:28:58 PDT Ville Voutilainen wrote:
> > mutex = spinlock + futex (wait / wake) + optional goodies
>
> Oh, I know where it sits in the abstraction-hierarchy of these things,
> but that doesn't make
> it in any way obvious that it should go first.

I'm not saying that spinlocks are required for slim mutexes or the other way
around. It is possible they will share some code, though.

I am saying that people are writing bad code for spinlocks today and my
evidence is that I found an example thereof inside libstdc++. So I am claiming
this is a bigger problem.

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

Received on 2021-08-30 13:41:28