C++ Logo

std-discussion

Advanced search

Re: Deprecation of volatile - Implications for exsiting code

From: Bjorn Reese <breese_at_[hidden]>
Date: Sun, 24 Nov 2024 15:47:19 +0100
On 11/24/24 03:03, J Decker via Std-Discussion wrote:

> I feel that a case study for implications of this wasn't really done
> very well - but then - maybe the usage of multi-threading is just that
> much less than I think it should be that this didn't show up. None of
> this has anything to do with Atomics and the locking of such a structure
> - some of them are lock-free.

std::atomic is the right tool for the problem you described.

In case you wonder why volatile does not work for multi-threading, see

   https://wg21.link/N2016

Received on 2024-11-24 14:47:23