<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: A couple of memory model questions in Intel® Moderncode for Parallel Architectures</title>
    <link>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/A-couple-of-memory-model-questions/m-p/991081#M6250</link>
    <description>&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;FONT color="#0000ff" size="2"&gt;&lt;/FONT&gt;
&lt;BLOCKQUOTE dir="ltr"&gt;
&lt;P&gt;&lt;FONT face="Verdana" color="#009900"&gt;though from the question it is not clear what the questioner is trying to do exactly.&lt;/FONT&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;HR /&gt;

&lt;P&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;P align="left"&gt;I believe he is trying to figure how many MFENCE instructions are needed for an IA-32/64 implementation of SMR.&lt;/P&gt;
&lt;P align="left"&gt;My implementation uses an MFENCE to prevent IA-32 from reordering the load, after store to another location case. I think we may need an extra MFENCE when you store into a hazard pointer that was null. Joe pointed this out on comp.programming.threads.&lt;/P&gt;</description>
    <pubDate>Sat, 21 May 2005 18:56:46 GMT</pubDate>
    <dc:creator>Chris_M__Thomasson</dc:creator>
    <dc:date>2005-05-21T18:56:46Z</dc:date>
    <item>
      <title>A couple of memory model questions</title>
      <link>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/A-couple-of-memory-model-questions/m-p/991079#M6248</link>
      <description>Can loads pass subsequent stores?  Can a load from a storage location different than that of a subsequent load occur after the store?  For example if the load location isn't in cache and the store location is in cache.&lt;BR /&gt;&lt;BR /&gt;If yes, then I guess you need an MFENCE as a memory barrier to a store.release operation unless your prior accesses were just stores.</description>
      <pubDate>Tue, 10 May 2005 19:25:33 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/A-couple-of-memory-model-questions/m-p/991079#M6248</guid>
      <dc:creator>jseigh</dc:creator>
      <dc:date>2005-05-10T19:25:33Z</dc:date>
    </item>
    <item>
      <title>Re: A couple of memory model questions</title>
      <link>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/A-couple-of-memory-model-questions/m-p/991080#M6249</link>
      <description>&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;Joe -&lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;I'm no expert at this kind of thing, so I went to someone that knows more than I. Here is his answer to your questions:&lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT color="#0000ff" size="2"&gt;
&lt;BLOCKQUOTE dir="ltr" style="MARGIN-RIGHT: 0px"&gt;
&lt;P&gt;&lt;FONT face="Verdana" color="#009900"&gt;Id recommend that they read &lt;/FONT&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;/FONT&gt;&lt;A href="http://www.intel.com/design/itanium/downloads/25142901.pdf" target="_blank"&gt;&lt;U&gt;&lt;FONT size="2"&gt;&lt;FONT face="Verdana" color="#009900"&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/U&gt;&lt;/A&gt;&lt;A href="http://www.intel.com/design/itanium/downloads/25142901.pdf" target="_blank"&gt;http://www.intel.com/design/itanium/downloads/25142901.pdf&lt;/A&gt;&lt;FONT color="#0000ff" size="2"&gt;&lt;FONT face="Verdana" color="#009900"&gt; if they have not already. (Though by the terminology they are using, they may have already read it.) &lt;/FONT&gt;&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Verdana" color="#009900"&gt;I believe that the answer to the question is that loads &lt;U&gt;can&lt;/U&gt; pass subsequent plain stores to a different location. But a load may not pass a subsequent store.release. So just a store.release should be necessary, not a full MFENCE, though from the question it is not clear what the questioner is trying to do exactly.&lt;/FONT&gt;&lt;/P&gt;&lt;/FONT&gt;
&lt;DIV&gt;--clay&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Sat, 21 May 2005 03:04:15 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/A-couple-of-memory-model-questions/m-p/991080#M6249</guid>
      <dc:creator>ClayB</dc:creator>
      <dc:date>2005-05-21T03:04:15Z</dc:date>
    </item>
    <item>
      <title>Re: A couple of memory model questions</title>
      <link>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/A-couple-of-memory-model-questions/m-p/991081#M6250</link>
      <description>&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;FONT color="#0000ff" size="2"&gt;&lt;/FONT&gt;
&lt;BLOCKQUOTE dir="ltr"&gt;
&lt;P&gt;&lt;FONT face="Verdana" color="#009900"&gt;though from the question it is not clear what the questioner is trying to do exactly.&lt;/FONT&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;HR /&gt;

&lt;P&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;P align="left"&gt;I believe he is trying to figure how many MFENCE instructions are needed for an IA-32/64 implementation of SMR.&lt;/P&gt;
&lt;P align="left"&gt;My implementation uses an MFENCE to prevent IA-32 from reordering the load, after store to another location case. I think we may need an extra MFENCE when you store into a hazard pointer that was null. Joe pointed this out on comp.programming.threads.&lt;/P&gt;</description>
      <pubDate>Sat, 21 May 2005 18:56:46 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/A-couple-of-memory-model-questions/m-p/991081#M6250</guid>
      <dc:creator>Chris_M__Thomasson</dc:creator>
      <dc:date>2005-05-21T18:56:46Z</dc:date>
    </item>
    <item>
      <title>Re: A couple of memory model questions</title>
      <link>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/A-couple-of-memory-model-questions/m-p/991082#M6251</link>
      <description>&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT size="3"&gt;&lt;SPAN&gt;You should not need MFENCE instructions with your lock free code. On x86 architecture LFENCE/SFENCE/MFENCE instructions are only used in combination with MOVNTDQ/MOVNTPD/MOVNTI/MASKMOVDQU.&lt;/SPAN&gt;&lt;SPAN&gt;Since your code dos not use SSE instructions memory fences are not necessary. See &lt;EM&gt;IA-32 Intel Architecture Software Developer's Manual&lt;/EM&gt;, Volume 1, Chapter 11.4.4 for more details.&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 02 Jun 2005 07:58:36 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/A-couple-of-memory-model-questions/m-p/991082#M6251</guid>
      <dc:creator>rshpount</dc:creator>
      <dc:date>2005-06-02T07:58:36Z</dc:date>
    </item>
    <item>
      <title>Re: A couple of memory model questions</title>
      <link>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/A-couple-of-memory-model-questions/m-p/991083#M6252</link>
      <description>&lt;DIV style="margin:0px;"&gt;&lt;DIV id="quote_reply" style="width: 100%; margin-top: 5px;"&gt;&lt;DIV style="margin-left:2px;margin-right:2px;"&gt;Quoting - &lt;A href="https://community.intel.com/en-us/profile/350920"&gt;rshpount&lt;/A&gt;&lt;/DIV&gt;&lt;DIV style="background-color:#E5E5E5; padding:5px;border: 1px; border-style: inset;margin-left:2px;margin-right:2px;"&gt;&lt;EM&gt; &lt;DIV&gt;&lt;SPAN style="font-size: small;"&gt;&lt;SPAN&gt;You should not need MFENCE instructions with your lock free code. On x86 architecture LFENCE/SFENCE/MFENCE instructions are only used in combination with MOVNTDQ/MOVNTPD/MOVNTI/MASKMOVDQU. &lt;/SPAN&gt;&lt;SPAN&gt; Since your code dos not use SSE instructions memory fences are not necessary. See &lt;EM&gt;IA-32 Intel Architecture Software Developer's Manual&lt;/EM&gt;, Volume 1, Chapter 11.4.4 for more details.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt; &lt;/EM&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is just not correct. LFENCE and SFENCE are really not necessary. But MFENCE is necessary in some situations, even if SSE is not used.&lt;/P&gt;&lt;P&gt;The main (the only?) source of reorderings in x86 is store buffer. In order to "neutralize" store buffer one have to use MFENCE.&lt;/P&gt;&lt;P&gt;One of the most famous examples where MFENCE is needed on x86 is Peterson's mutual exclusion algorithm:&lt;/P&gt;&lt;P&gt;&lt;A href="http://en.wikipedia.org/wiki/Peterson%27s_algorithm"&gt;http://en.wikipedia.org/wiki/Peterson%27s_algorithm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;One can see details of x86 ordering rules in "Intel 64 Architecture Memory Ordering White Paper":&lt;/P&gt;&lt;P&gt;&lt;A href="http://developer.intel.com/products/processor/manuals/318147.pdf"&gt;http://developer.intel.com/products/processor/manuals/318147.pdf&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 30 Sep 2008 14:48:36 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/A-couple-of-memory-model-questions/m-p/991083#M6252</guid>
      <dc:creator>Dmitry_Vyukov</dc:creator>
      <dc:date>2008-09-30T14:48:36Z</dc:date>
    </item>
  </channel>
</rss>

