C++ Logo

std-proposals

Advanced search

Re: [std-proposals] Opt out of multi-threading protection for static variables inside functions

From: Thiago Macieira <thiago_at_[hidden]>
Date: Sun, 27 Oct 2024 10:55:17 -0700
On Sunday 27 October 2024 09:57:31 Pacific Daylight Time Frederick Virchanza
Gotham via Std-Proposals wrote:
> Sometimes we don't want this, for example if:
> (1) The function will only ever be called by the same thread -- this
> is very common in GUI programs (i.e. only the GUI thread calls the
> function)
> (2) You have your own locks inside the function
>
> C++ has always been about efficiency -- not paying for things that you
> don't use. So how about we be able to opt out of the multi-threading
> protection?

This sounds like QoI request, though.

-- 
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
  Principal Engineer - Intel DCAI Platform & System Engineering

Received on 2024-10-27 17:55:21