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


Groups > comp.programming.threads > #251

Re: Implicit memory barriers on x86

Path csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!goblin2!goblin.stu.neva.ru!newsfeed2.atman.pl!newsfeed.atman.pl!.POSTED!not-for-mail
From Edek <edek.pienkowski@gmail.com>
Newsgroups comp.programming.threads
Subject Re: Implicit memory barriers on x86
Date Wed, 08 Jun 2011 23:41:53 +0200
Organization ATMAN - ATM S.A.
Lines 37
Message-ID <isoqar$ot6$1@node2.news.atman.pl> (permalink)
References <071a9804-ceb8-4276-bfe2-7796359170ec@16g2000yqy.googlegroups.com> <isof2a$ck2$1@node2.news.atman.pl> <7ab821b3-091a-4a44-8f27-ba859506d459@28g2000yqu.googlegroups.com>
NNTP-Posting-Host 213.241.90.232
Mime-Version 1.0
Content-Type text/plain; charset=windows-1252; format=flowed
Content-Transfer-Encoding 7bit
X-Trace node2.news.atman.pl 1307569307 25510 213.241.90.232 (8 Jun 2011 21:41:47 GMT)
X-Complaints-To usenet@atman.pl
NNTP-Posting-Date Wed, 8 Jun 2011 21:41:47 +0000 (UTC)
User-Agent Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.17) Gecko/20110428 Linux/3.1.0-15 Thunderbird/3.1.0
In-Reply-To <7ab821b3-091a-4a44-8f27-ba859506d459@28g2000yqu.googlegroups.com>
Xref x330-a1.tempe.blueboxinc.net comp.programming.threads:251

Show key headers only | View raw


Assuming you need this

Thr 1

lock_by_xchg
read mem1

Thr2
write ->mem1
write -> spinlock

Isn't that already ordered? For thr2, writes are seen in consistent 
order, for Thr 1 there is total ordering anyway.

Otherwise, see 8.2.3.5. Isn't this affecting

> push eax  #1 store
> pop   eax  #2 load

>> >
>>> > > Seems like based on the above rules:
>>> > > 1) #1 and #2 - no reorder per (D)
>
>> D) Reads may be reordered with older writes to different locations but
>> > > not with older writes to the same location.
>>


Here, #2 will happen before #1, though it gets #1's value.

Edek

PS. Sorry for my previous remark, I never do threads targeting a
CPU family. These guarantees are not general threading guarantees,
and 8.2.5 near the end. I guess you're can retarget whatever
you're writing, when a new CPU is available.

Back to comp.programming.threads | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Implicit memory barriers on x86 Rani Sharoni <ranisharoni75@gmail.com> - 2011-06-07 13:47 -0700
  Re: Implicit memory barriers on x86 David Schwartz <davids@webmaster.com> - 2011-06-08 10:11 -0700
    Re: Implicit memory barriers on x86 Rani Sharoni <ranisharoni75@gmail.com> - 2011-06-08 12:53 -0700
  Re: Implicit memory barriers on x86 Edek <edek.pienkowski@gmail.com> - 2011-06-08 20:29 +0200
    Re: Implicit memory barriers on x86 Rani Sharoni <ranisharoni75@gmail.com> - 2011-06-08 12:48 -0700
      Re: Implicit memory barriers on x86 Edek <edek.pienkowski@gmail.com> - 2011-06-08 23:41 +0200
        Re: Implicit memory barriers on x86 Rani Sharoni <ranisharoni75@gmail.com> - 2011-06-08 22:19 -0700
        Re: Implicit memory barriers on x86 David Schwartz <davids@webmaster.com> - 2011-06-09 16:25 -0700
  Re: Implicit memory barriers on x86 Rani Sharoni <ranisharoni75@gmail.com> - 2011-06-10 14:19 -0700
    Re: Implicit memory barriers on x86 David Schwartz <davids@webmaster.com> - 2011-06-11 02:57 -0700
      Re: Implicit memory barriers on x86 Rani Sharoni <ranisharoni75@gmail.com> - 2011-06-11 09:21 -0700
        Re: Implicit memory barriers on x86 Edek <edek.pienkowski@gmail.com> - 2011-06-11 22:26 +0200
    Re: Implicit memory barriers on x86 Alexander Terekhov <terekhov@web.de> - 2011-06-11 12:31 +0200
      Re: Implicit memory barriers on x86 "Chris M. Thomasson" <cristom@charter.net> - 2011-06-13 09:51 -0700
    Re: Implicit memory barriers on x86 Rani Sharoni <ranisharoni75@gmail.com> - 2011-06-11 12:30 -0700
      Re: Implicit memory barriers on x86 Edek <edek.pienkowski@gmail.com> - 2011-06-11 22:18 +0200
        Re: Implicit memory barriers on x86 Rani Sharoni <ranisharoni75@gmail.com> - 2011-06-11 13:31 -0700

csiph-web