Path: csiph.com!eeepc.pasdenom.info!news.pasdenom.info!news.dougwise.org!news.davenulle.org!porbandar.httrack.net!news.httrack.net!feeder.erje.net!newsfeed.datemas.de!feed.cnntp.org!news.cnntp.org!not-for-mail From: Anthony Williams Newsgroups: comp.programming.threads Subject: Re: forcing the compiler to reload from memory with c++0x References: <4d3cee42$0$1209$426a74cc@news.free.fr> <1d21ad0a-db55-460e-aeb6-66f6d19369ea@i13g2000yqe.googlegroups.com> <4d3e2e3f$0$21517$426a34cc@news.free.fr> <4D40A4C7.16E6F9AE@web.de> <69d82db7-34be-4de7-86c4-2f39cc1e6df3@m13g2000yqb.googlegroups.com> <4d4221e9$0$17247$426a74cc@news.free.fr> <947b33d5-2509-4f0c-9256-a7c3de35578e@24g2000yqa.googlegroups.com> <87mxmlxxry.fsf@justsoftwaresolutions.co.uk> <87oc6yxdcw.fsf@justsoftwaresolutions.co.uk> <87sjw8w4b5.fsf@justsoftwaresolutions.co.uk> <87sjw49oe8.fsf@justsoftwaresolutions.co.uk> <4D4C1DCA.69308F8E@web.de> Date: Fri, 04 Feb 2011 17:52:39 +0000 Message-ID: <87aaibadqw.fsf@justsoftwaresolutions.co.uk> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) Cancel-Lock: sha1:WEavFfl7Iv9JLbG5Cpc7Chs6A+c= MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Lines: 21 Organization: CNNTP NNTP-Posting-Host: d0ed1f29.read.cnntp.org X-Trace: DXC=gW_0Xg\I`ch[O`b`RHllLhWoT\PAgXa?a1LKeO=ej5Zh31?8ZVJ3gMeGj6PdB418WnU3G?UUf05BlHfXlf2K3O]o X-Complaints-To: abuse@cnntp.org Xref: csiph.com comp.programming.threads:1844 Alexander Terekhov writes: > Anthony Williams wrote: > [...] >> I'm saying if you want to force the compiler to emit a specific >> sequence of operations (at the assembly level) then you need to use >> volatile. > > The C/C++ does not guarantee the existence of assembly level to begin > with. "Assembly level" can be the same text as coded in C/C++ top level > (front end) and implementation can simply interpret/execute it. Yes, technically, you're right. In practice, what I said holds (e.g. with gcc, as I posted before). Anthony -- Author of C++ Concurrency in Action http://www.stdthread.co.uk/book/ just::thread C++0x thread library http://www.stdthread.co.uk Just Software Solutions Ltd http://www.justsoftwaresolutions.co.uk 15 Carrallack Mews, St Just, Cornwall, TR19 7UL, UK. Company No. 5478976