Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c++ > #123825

Re: std::atomic work as volatile, or not, I think not...

Path csiph.com!weretis.net!feeder9.news.weretis.net!panix!.POSTED.spitfire.i.gajendra.net!not-for-mail
From cross@spitfire.i.gajendra.net (Dan Cross)
Newsgroups comp.lang.c++
Subject Re: std::atomic work as volatile, or not, I think not...
Date Mon, 11 May 2026 11:53:10 -0000 (UTC)
Organization PANIX Public Access Internet and UNIX, NYC
Message-ID <10tsfv6$3fe$1@reader1.panix.com> (permalink)
References <10trn7n$s8gl$1@dont-email.me> <10trspj$t8pr$2@dont-email.me> <10ts3vt$3v1g3$1@dont-email.me> <10ts5ur$updt$2@dont-email.me>
Injection-Date Mon, 11 May 2026 11:53:10 -0000 (UTC)
Injection-Info reader1.panix.com; posting-host="spitfire.i.gajendra.net:166.84.136.80"; logging-data="3566"; mail-complaints-to="abuse@panix.com"
X-Newsreader trn 4.0-test77 (Sep 1, 2010)
Originator cross@spitfire.i.gajendra.net (Dan Cross)
Xref csiph.com comp.lang.c++:123825

Show key headers only | View raw


In article <10ts5ur$updt$2@dont-email.me>,
David Brown  <david.brown@hesbynett.no> wrote:
>On 11/05/2026 10:28, boltar@caprica.universe wrote:
>> On Mon, 11 May 2026 08:25:55 +0200
>> David Brown <david.brown@hesbynett.no> gabbled:
>>> On 11/05/2026 06:51, Chris M. Thomasson wrote:
>>>> Well, damn. It seems that std::atomic might not be sufficient, and 
>>>> volatile needs to be used.
>>>>
>>>
>>> I very much hope to be corrected if someone thinks my reasoning below 
>>> is incorrect - I am not an expert here by any means.
>> 
>> Whats the point of std::atomic anyway? Just how often does a thread 
>> critical
>> section just require the test and set of a single value? And if you do
>> want to do that posix semaphores have been a thing since the early 90s
>> and SysV ones since at least the 80s if not earlier.
>> 
>
>Atomics are for shared information /without/ needing semaphores, 
>critical sections or other more expensive operations.  Read up about 
>non-blocking or lock-free algorithms.

And also for implementing such things.

	- Dan C.

Back to comp.lang.c++ | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

std::atomic work as volatile, or not, I think not... "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2026-05-10 21:51 -0700
  Re: std::atomic work as volatile, or not, I think not... David Brown <david.brown@hesbynett.no> - 2026-05-11 08:25 +0200
    Re: std::atomic work as volatile, or not, I think not... boltar@caprica.universe - 2026-05-11 08:28 +0000
      Re: std::atomic work as volatile, or not, I think not... David Brown <david.brown@hesbynett.no> - 2026-05-11 11:02 +0200
        Re: std::atomic work as volatile, or not, I think not... boltar@caprica.universe - 2026-05-11 10:59 +0000
          Re: std::atomic work as volatile, or not, I think not... David Brown <david.brown@hesbynett.no> - 2026-05-11 13:20 +0200
            Re: std::atomic work as volatile, or not, I think not... Bonita Montero <Bonita.Montero@gmail.com> - 2026-05-11 13:22 +0200
              Re: std::atomic work as volatile, or not, I think not... "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2026-05-11 13:00 -0700
            Re: std::atomic work as volatile, or not, I think not... boltar@caprica.universe - 2026-05-11 15:08 +0000
              Re: std::atomic work as volatile, or not, I think not... David Brown <david.brown@hesbynett.no> - 2026-05-11 22:19 +0200
                Re: std::atomic work as volatile, or not, I think not... "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2026-05-11 13:25 -0700
            Re: std::atomic work as volatile, or not, I think not... scott@slp53.sl.home (Scott Lurndal) - 2026-05-11 15:48 +0000
              Re: std::atomic work as volatile, or not, I think not... "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2026-05-11 13:09 -0700
          Re: std::atomic work as volatile, or not, I think not... Bonita Montero <Bonita.Montero@gmail.com> - 2026-05-11 13:21 +0200
          Re: std::atomic work as volatile, or not, I think not... "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2026-05-11 12:48 -0700
            Re: std::atomic work as volatile, or not, I think not... red floyd <no.spam.here@its.invalid> - 2026-05-11 21:04 -0700
              Re: std::atomic work as volatile, or not, I think not... "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2026-05-14 00:35 -0700
        Re: std::atomic work as volatile, or not, I think not... cross@spitfire.i.gajendra.net (Dan Cross) - 2026-05-11 11:53 +0000
          Re: std::atomic work as volatile, or not, I think not... David Brown <david.brown@hesbynett.no> - 2026-05-11 15:18 +0200
            Re: std::atomic work as volatile, or not, I think not... Bonita Montero <Bonita.Montero@gmail.com> - 2026-05-11 15:20 +0200
              Re: std::atomic work as volatile, or not, I think not... "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2026-05-11 12:54 -0700
  Re: std::atomic work as volatile, or not, I think not... "Fred. Zwarts" <F.Zwarts@HetNet.nl> - 2026-05-11 11:46 +0200
    Re: std::atomic work as volatile, or not, I think not... David Brown <david.brown@hesbynett.no> - 2026-05-11 12:40 +0200
      Re: std::atomic work as volatile, or not, I think not... Chris Ahlstrom <OFeem1987@teleworm.us> - 2026-05-11 06:55 -0400
        Re: std::atomic work as volatile, or not, I think not... "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2026-05-12 12:14 -0700
    Re: std::atomic work as volatile, or not, I think not... scott@slp53.sl.home (Scott Lurndal) - 2026-05-11 15:49 +0000
      Re: std::atomic work as volatile, or not, I think not... "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2026-05-11 12:36 -0700

csiph-web