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


Groups > comp.programming.threads > #1781

Re: forcing the compiler to reload from memory with c++0x

From Alexander Terekhov <terekhov@web.de>
Newsgroups comp.programming.threads
Subject Re: forcing the compiler to reload from memory with c++0x
Date 2011-02-01 14:17 +0100
Organization A noiseless patient Spider
Message-ID <4D480800.1C5132D7@web.de> (permalink)
References (7 earlier) <87mxmlxxry.fsf@justsoftwaresolutions.co.uk> <ihv8t6$bmr$1@news.eternal-september.org> <87oc6yxdcw.fsf@justsoftwaresolutions.co.uk> <ii745u$5q3$1@news.eternal-september.org> <87sjw8w4b5.fsf@justsoftwaresolutions.co.uk>

Show all headers | View raw


Anthony Williams wrote:
[...]
> You can of course make your atomic variables volatile too, and then they
> DO become observable behaviour.

Observable as in what? Memory mapped I/O variables and signal handlers
aside, you can't mean debuggers and/or asm listings. The following
programs

int main() {
  volatile int i;
  // volatile write = has no observable effect
  i = 1;
  // volatile read = has no observable effect
  int n = i;
  // output: 1
  std::cout << n;
}

int main() {
  // output: 1
  std::cout << 1;
}

can be translated into the same executable code.

regards,
alexander.

Back to comp.programming.threads | Previous | NextNext in thread | Find similar


Thread

Re: forcing the compiler to reload from memory with c++0x Alexander Terekhov <terekhov@web.de> - 2011-02-01 14:17 +0100
  Re: forcing the compiler to reload from memory with c++0x Alexander Terekhov <terekhov@web.de> - 2011-02-02 14:45 +0100
    Re: forcing the compiler to reload from memory with c++0x Dmitriy Vyukov <dvyukov@gmail.com> - 2011-02-02 07:02 -0800
      Re: forcing the compiler to reload from memory with c++0x Alexander Terekhov <terekhov@web.de> - 2011-02-02 16:33 +0100
  Re: forcing the compiler to reload from memory with c++0x Alexander Terekhov <terekhov@web.de> - 2011-02-01 16:32 +0100
    Re: forcing the compiler to reload from memory with c++0x Alexander Terekhov <terekhov@web.de> - 2011-02-02 12:13 +0100
      Re: forcing the compiler to reload from memory with c++0x Dmitriy Vyukov <dvyukov@gmail.com> - 2011-02-02 04:54 -0800
    Re: forcing the compiler to reload from memory with c++0x Dmitriy Vyukov <dvyukov@gmail.com> - 2011-02-01 21:02 -0800
    Re: forcing the compiler to reload from memory with c++0x Joshua Maurice <joshuamaurice@gmail.com> - 2011-02-01 15:19 -0800
  Re: forcing the compiler to reload from memory with c++0x Anthony Williams <anthony.ajw@gmail.com> - 2011-02-01 13:51 +0000

csiph-web