C++ Logo


Advanced search

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

From: Ville Voutilainen <ville.voutilainen_at_[hidden]>
Date: Mon, 30 Aug 2021 20:07:41 +0300
On Mon, 30 Aug 2021 at 19:18, Thiago Macieira via Std-Proposals
<std-proposals_at_[hidden]> wrote:
> > Sure, but the reason to standardize this type is that it's designed to
> > be portably very small,
> > whereas std::mutex isn't.
> I don't think the standard can do that. It's possible on some platforms that
> have no recourse to something better, that it's just a wrapper around
> std::mutex.

Sure, but there's still a difference between "it's possible that it
just isn't small"
and "we know it's not small and can't be made small". :) The former is
indeed an impossible
thing for the standard to guarantee, but at least it allows, for some
platforms, perhaps
many, to avoid the problem of the latter, whereas rainy wishes of
ABI-breaking size shrinkage in std::mutex are not realistic.

Received on 2021-08-30 12:07:58