<?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 memory ordering model in Intel® Moderncode for Parallel Architectures</title>
    <link>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/memory-ordering-model/m-p/896075#M3999</link>
    <description>I'd like to know if memory reads are done in-order or not.&lt;BR /&gt;&lt;BR /&gt;According to Intel 64 and IA-32 Architectures Software Developer's manual Vol 3A, Nov 2007, subsection 7.2.2:&lt;BR /&gt;Reads can be carried out speculatively and in any order.&lt;BR /&gt;&lt;BR /&gt;But the newer revision, July 2008, says "Reads are not reordered with other reads".&lt;BR /&gt;&lt;BR /&gt;I would assume newer revision is correct, but like to have confirmation.&lt;BR /&gt;&lt;BR /&gt;Also, does this mean any instruction reads from memory can be considered as load&lt;BR /&gt;memory barrier? (i.e. can be used instead of lfence)&lt;BR /&gt;</description>
    <pubDate>Thu, 28 Aug 2008 01:54:47 GMT</pubDate>
    <dc:creator>tadayuki</dc:creator>
    <dc:date>2008-08-28T01:54:47Z</dc:date>
    <item>
      <title>memory ordering model</title>
      <link>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/memory-ordering-model/m-p/896075#M3999</link>
      <description>I'd like to know if memory reads are done in-order or not.&lt;BR /&gt;&lt;BR /&gt;According to Intel 64 and IA-32 Architectures Software Developer's manual Vol 3A, Nov 2007, subsection 7.2.2:&lt;BR /&gt;Reads can be carried out speculatively and in any order.&lt;BR /&gt;&lt;BR /&gt;But the newer revision, July 2008, says "Reads are not reordered with other reads".&lt;BR /&gt;&lt;BR /&gt;I would assume newer revision is correct, but like to have confirmation.&lt;BR /&gt;&lt;BR /&gt;Also, does this mean any instruction reads from memory can be considered as load&lt;BR /&gt;memory barrier? (i.e. can be used instead of lfence)&lt;BR /&gt;</description>
      <pubDate>Thu, 28 Aug 2008 01:54:47 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/memory-ordering-model/m-p/896075#M3999</guid>
      <dc:creator>tadayuki</dc:creator>
      <dc:date>2008-08-28T01:54:47Z</dc:date>
    </item>
    <item>
      <title>Re: memory ordering model</title>
      <link>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/memory-ordering-model/m-p/896076#M4000</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;DIV&gt;&lt;IMG src="https://community.intel.com/file/6745" /&gt; &lt;STRONG&gt;tadayuki:&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;BR /&gt;I'd like to know if memory reads are done in-order or not.&lt;BR /&gt;&lt;/DIV&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;Mostly in order, but not always.&lt;BR /&gt;More precisely loads are done (retired) in order, but perceived order (from point of view of other threads) can differ from program order.&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE&gt;&lt;DIV&gt;&lt;IMG src="https://community.intel.com/file/6745" /&gt; &lt;STRONG&gt;tadayuki:&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;BR /&gt;According to Intel 64 and IA-32 Architectures Software Developer's manual Vol 3A, Nov 2007, subsection 7.2.2:&lt;BR /&gt;Reads can be carried out speculatively and in any order.&lt;BR /&gt;&lt;BR /&gt;But the newer revision, July 2008, says "Reads are not reordered with other reads".&lt;BR /&gt;&lt;BR /&gt;I would assume newer revision is correct, but like to have confirmation.&lt;BR /&gt;&lt;/DIV&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;Loads can be *executed* out-of-order, but *retired* always in order. And until load is retired, if there is some cache coherence traffic wrt loaded value, value is "patched".&lt;BR /&gt;So basically both definitions are correct :)&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE&gt;&lt;DIV&gt;&lt;IMG src="https://community.intel.com/file/6745" /&gt; &lt;STRONG&gt;tadayuki:&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;BR /&gt;Also, does this mean any instruction reads from memory can be considered as load&lt;BR /&gt;memory barrier? (i.e. can be used instead of lfence)&lt;BR /&gt;&lt;/DIV&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;Well, I think yes. But this fact really makes little sense. Because lfence is useless on x86.&lt;BR /&gt;In some situations perceived order of loads execution can differ from program order, and lfence won't help here, nor another load in-between won't help. Only mfence will help.&lt;BR /&gt;&lt;BR /&gt;If you will provide some example code, than I will be able to say exactly whether reorderings are possible or not in this code.&lt;BR /&gt;&lt;BR /&gt;Dmitriy V'jukov&lt;BR /&gt;</description>
      <pubDate>Thu, 28 Aug 2008 23:18:39 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/memory-ordering-model/m-p/896076#M4000</guid>
      <dc:creator>Intel_C_Intel</dc:creator>
      <dc:date>2008-08-28T23:18:39Z</dc:date>
    </item>
    <item>
      <title>Re: memory ordering model</title>
      <link>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/memory-ordering-model/m-p/896077#M4001</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;DIV&gt;&lt;IMG src="https://community.intel.com/file/6745" /&gt; &lt;STRONG&gt;dvyukov:&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;BR /&gt;If you will provide some example code, than I will be able to say exactly whether reorderings are possible or not in this code.&lt;BR /&gt;&lt;BR /&gt;Dmitriy V'jukov&lt;BR /&gt;&lt;/DIV&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;I've changed my Login ID from 'dvyukov' back to 'randomizer'. It seems that ISN has serious problems with Login ID change. When you change your Login ID, basically you lost all your previous posts. And if than someone will change his Login ID to your old Login ID, he will effectively steal all your previous posts. LOL!&lt;BR /&gt;So it's better to not play with Logic ID change on ISN :)&lt;BR /&gt;&lt;BR /&gt;Dmitriy V'jukov&lt;BR /&gt;</description>
      <pubDate>Thu, 28 Aug 2008 23:35:31 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/memory-ordering-model/m-p/896077#M4001</guid>
      <dc:creator>Intel_C_Intel</dc:creator>
      <dc:date>2008-08-28T23:35:31Z</dc:date>
    </item>
    <item>
      <title>Re: memory ordering model</title>
      <link>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/memory-ordering-model/m-p/896078#M4002</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;DIV&gt;&lt;IMG src="https://community.intel.com/file/6745" /&gt; &lt;STRONG&gt;dvyukov:&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;BLOCKQUOTE&gt;&lt;DIV&gt;&lt;IMG src="https://community.intel.com/file/6745" /&gt; &lt;STRONG&gt;dvyukov:&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;BR /&gt;If you will provide some example code, than I will be able to say exactly whether reorderings are possible or not in this code.&lt;BR /&gt;&lt;BR /&gt;Dmitriy V'jukov&lt;BR /&gt;&lt;/DIV&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;I've changed my Login ID from 'dvyukov' back to 'randomizer'. It seems that ISN has serious problems with Login ID change. When you change your Login ID, basically you lost all your previous posts. And if than someone will change his Login ID to your old Login ID, he will effectively steal all your previous posts. LOL!&lt;BR /&gt;So it's better to not play with Logic ID change on ISN :)&lt;BR /&gt;&lt;BR /&gt;Dmitriy V'jukov&lt;BR /&gt;&lt;/DIV&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;I've already changed my Login ID to 'randomizer', and already explicitly signed in as 'randomizer', and my previous post still came from 'dvyukov' account. LOL&lt;BR /&gt;I hope this time post will be from 'randomizer'. Let's see :)&lt;BR /&gt;&lt;BR /&gt;Dmitriy V'jukov&lt;BR /&gt;</description>
      <pubDate>Thu, 28 Aug 2008 23:38:41 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/memory-ordering-model/m-p/896078#M4002</guid>
      <dc:creator>Dmitry_Vyukov</dc:creator>
      <dc:date>2008-08-28T23:38:41Z</dc:date>
    </item>
    <item>
      <title>Re: memory ordering model</title>
      <link>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/memory-ordering-model/m-p/896079#M4003</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;DIV&gt;&lt;IMG src="https://community.intel.com/file/6745" /&gt; &lt;STRONG&gt;randomizer:&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;BLOCKQUOTE&gt;&lt;DIV&gt;&lt;IMG src="https://community.intel.com/file/6745" /&gt; &lt;STRONG&gt;dvyukov:&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;BLOCKQUOTE&gt;&lt;DIV&gt;&lt;IMG src="https://community.intel.com/file/6745" /&gt; &lt;STRONG&gt;dvyukov:&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;BR /&gt;If you will provide some example code, than I will be able to say exactly whether reorderings are possible or not in this code.&lt;BR /&gt;&lt;BR /&gt;Dmitriy V'jukov&lt;BR /&gt;&lt;/DIV&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;I've changed my Login ID from 'dvyukov' back to 'randomizer'. It seems that ISN has serious problems with Login ID change. When you change your Login ID, basically you lost all your previous posts. And if than someone will change his Login ID to your old Login ID, he will effectively steal all your previous posts. LOL!&lt;BR /&gt;So it's better to not play with Logic ID change on ISN :)&lt;BR /&gt;&lt;BR /&gt;Dmitriy V'jukov&lt;BR /&gt;&lt;/DIV&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;I've already changed my Login ID to 'randomizer', and already explicitly signed in as 'randomizer', and my previous post still came from 'dvyukov' account. LOL&lt;BR /&gt;I hope this time post will be from 'randomizer'. Let's see :)&lt;BR /&gt;&lt;BR /&gt;Dmitriy V'jukov&lt;BR /&gt;&lt;/DIV&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;WOW! Miracle happened! I get all my posts back! Incredible!&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 28 Aug 2008 23:44:31 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/memory-ordering-model/m-p/896079#M4003</guid>
      <dc:creator>Dmitry_Vyukov</dc:creator>
      <dc:date>2008-08-28T23:44:31Z</dc:date>
    </item>
    <item>
      <title>Re: memory ordering model</title>
      <link>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/memory-ordering-model/m-p/896080#M4004</link>
      <description>&lt;P&gt;&lt;FONT size="3"&gt;Thanks for the explanation.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="3"&gt;&lt;BR /&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;DIV&gt;&lt;IMG src="https://community.intel.com/file/6745" /&gt; &lt;STRONG&gt;dvyukov:&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="3"&gt;If you will provide some example code, than I will be able to say exactly whether reorderings are possible or not in this code.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="3"&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;/DIV&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="3"&gt;&lt;BR /&gt;I'm working on a ticket based spinlock implementation. (BTW, I'm new to IA.) Basically, it has ticket counter and service counter and if the ticket you have matches to the service counter, you get the lock.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="3"&gt;&lt;BR /&gt;spin_lock() atomically increments the ticket counter and keeps the original value as my ticket. Then it checks the service counter if it matches to my ticket:&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="3"&gt; cmpl svc_ctr, %eax /* %eax == my_tkt */&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="3"&gt; je critical_section&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="3"&gt;In the critical section, you don't want speculatively loaded value before you get the lock. If reads are not done in order, I would think lfence is needed after cmpl, but it looks like there's no need for it.&lt;BR /&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="3"&gt;&lt;BR /&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="3"&gt;Also, spin_unlock() increments the service counter:&lt;BR /&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="3"&gt; addl $1, svc_ctr&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="3"&gt;A mfence would be required before 'add' if reads and writes are not done in order respectively. (On PowerPC, we use 'sync' instruction.) But 'add' seems to work as a full memory barrier if I'm reading the manual correctly.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="3"&gt;Would you agree with my assesment?&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="3"&gt;Thanks.&lt;/FONT&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 29 Aug 2008 00:49:09 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/memory-ordering-model/m-p/896080#M4004</guid>
      <dc:creator>tadayuki</dc:creator>
      <dc:date>2008-08-29T00:49:09Z</dc:date>
    </item>
    <item>
      <title>Re: memory ordering model</title>
      <link>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/memory-ordering-model/m-p/896081#M4005</link>
      <description>This algorithm will work w/o any additional fences. On x86 every load is load-acquire. And every store is store-release. So nothing can hoist above load, and nothing can sink below store.&lt;BR /&gt;Final load of &lt;FONT size="3"&gt;svc_ctr wil&lt;/FONT&gt;l provide all necessary synchronization wrt lock acquisition. And increment &lt;FONT size="3"&gt;(store) &lt;/FONT&gt;of &lt;FONT size="3"&gt;svc_ctr &lt;/FONT&gt;will provide all necessary synchronization wrt lock release.&lt;BR /&gt;&lt;BR /&gt;Btw, don't forget to insert 'pause' instruction into spin-loop, if spin-loop is active (i.e. not sched_yield()).&lt;BR /&gt;</description>
      <pubDate>Fri, 29 Aug 2008 01:00:42 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/memory-ordering-model/m-p/896081#M4005</guid>
      <dc:creator>Dmitry_Vyukov</dc:creator>
      <dc:date>2008-08-29T01:00:42Z</dc:date>
    </item>
    <item>
      <title>Re: memory ordering model</title>
      <link>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/memory-ordering-model/m-p/896082#M4006</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;DIV&gt;&lt;IMG src="https://community.intel.com/file/6745" /&gt; &lt;STRONG&gt;randomizer:&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;This algorithm will work w/o any additional fences. On x86 every load is load-acquire. And every store is store-release. So nothing can hoist above load, and nothing can sink below store.&lt;BR /&gt;Final load of &lt;FONT size="3"&gt;svc_ctr wil&lt;/FONT&gt;l provide all necessary synchronization wrt lock acquisition. And increment &lt;FONT size="3"&gt;(store) &lt;/FONT&gt;of &lt;FONT size="3"&gt;svc_ctr &lt;/FONT&gt;will provide all necessary synchronization wrt lock release.&lt;BR /&gt;&lt;/DIV&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;Thanks. That's good to know.&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE&gt;&lt;DIV&gt;&lt;IMG src="https://community.intel.com/file/6745" /&gt; &lt;STRONG&gt;randomizer:&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;BR /&gt;Btw, don't forget to insert 'pause' instruction into spin-loop, if spin-loop is active (i.e. not sched_yield()).&lt;BR /&gt;&lt;/DIV&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;Thanks for the reminder. I did add 'pause' in the loop.&lt;BR /&gt;(Though, I'm not so sure about what it does.) &lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;</description>
      <pubDate>Fri, 29 Aug 2008 01:10:59 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/memory-ordering-model/m-p/896082#M4006</guid>
      <dc:creator>tadayuki</dc:creator>
      <dc:date>2008-08-29T01:10:59Z</dc:date>
    </item>
    <item>
      <title>Re: memory ordering model</title>
      <link>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/memory-ordering-model/m-p/896083#M4007</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;DIV&gt;&lt;IMG src="https://community.intel.com/file/6745" /&gt; &lt;STRONG&gt;tadayuki:&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;BR /&gt;&lt;BLOCKQUOTE&gt;&lt;DIV&gt;&lt;IMG src="https://community.intel.com/file/6745" /&gt; &lt;STRONG&gt;randomizer:&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;BR /&gt;Btw, don't forget to insert 'pause' instruction into spin-loop, if spin-loop is active (i.e. not sched_yield()).&lt;BR /&gt;&lt;/DIV&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;Thanks for the reminder. I did add 'pause' in the loop.&lt;BR /&gt;(Though, I'm not so sure about what it does.) &lt;BR /&gt;&lt;/DIV&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;If you have tight active spin-loop:&lt;BR /&gt;&lt;BR /&gt;while (some_var)&lt;BR /&gt; pause;&lt;BR /&gt;&lt;BR /&gt;Without pause instruction, superscalar processor can issue a lot of load request, i.e. there will be more than one load request at the same time. It's absolutely unnecessary, and degrades performance. With pause instruction there will be at most one active load request at any given time.&lt;BR /&gt;Also on Hyper-Threaded processors pause instruction informs core, that current thread just spinning and not doing useful work, so core can give priority to other thread(s).&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 29 Aug 2008 11:19:52 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/memory-ordering-model/m-p/896083#M4007</guid>
      <dc:creator>Dmitry_Vyukov</dc:creator>
      <dc:date>2008-08-29T11:19:52Z</dc:date>
    </item>
    <item>
      <title>Re: memory ordering model</title>
      <link>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/memory-ordering-model/m-p/896084#M4008</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;DIV&gt;&lt;IMG src="https://community.intel.com/file/6745" /&gt; &lt;STRONG&gt;tadayuki:&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;BLOCKQUOTE&gt;&lt;DIV&gt;&lt;IMG src="https://community.intel.com/file/6745" /&gt; &lt;STRONG&gt;randomizer:&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;This algorithm will work w/o any additional fences. On x86 every load is load-acquire. And every store is store-release. So nothing can hoist above load, and nothing can sink below store.&lt;BR /&gt;Final load of &lt;FONT size="3"&gt;svc_ctr wil&lt;/FONT&gt;l provide all necessary synchronization wrt lock acquisition. And increment &lt;FONT size="3"&gt;(store) &lt;/FONT&gt;of &lt;FONT size="3"&gt;svc_ctr &lt;/FONT&gt;will provide all necessary synchronization wrt lock release.&lt;BR /&gt;&lt;/DIV&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;Thanks. That's good to know.&lt;BR /&gt;&lt;/DIV&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;Hmmm.... I'm thinking about incorporating x86 memory model into Relacy Race Detector:&lt;BR /&gt;&lt;A href="http://software.intel.com/en-us/forums//topic/60050" target="_blank"&gt;http://software.intel.com/en-us/forums//topic/60050&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Initially I was thinking that if I will provide extremely relaxed C++0x memory model, than user can map any other memory model to C++0x memory model, thus test algorithm against, for example, x86 memory model.&lt;BR /&gt;&lt;BR /&gt;The problem here is that user have to precisely understand and C++0x MM and his target MM (x86), in order to create correct mapping. So if I will provide direct support for x86 MM this can be of help.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 29 Aug 2008 11:33:37 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/memory-ordering-model/m-p/896084#M4008</guid>
      <dc:creator>Dmitry_Vyukov</dc:creator>
      <dc:date>2008-08-29T11:33:37Z</dc:date>
    </item>
    <item>
      <title>Re: memory ordering model</title>
      <link>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/memory-ordering-model/m-p/896085#M4009</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;DIV&gt;&lt;IMG src="https://community.intel.com/file/6745" /&gt; &lt;STRONG&gt;randomizer:&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;BR /&gt;If you have tight active spin-loop:&lt;BR /&gt;&lt;BR /&gt;while (some_var)&lt;BR /&gt; pause;&lt;BR /&gt;&lt;BR /&gt;Without pause instruction, superscalar processor can issue a lot of load request, i.e. there will be more than one load request at the same time. It's absolutely unnecessary, and degrades performance. With pause instruction there will be at most one active load request at any given time.&lt;BR /&gt;Also on Hyper-Threaded processors pause instruction informs core, that current thread just spinning and not doing useful work, so core can give priority to other thread(s).&lt;BR /&gt;&lt;/DIV&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;I see. I did know it helps Hyper-Threading but we are not using it. So I wasn't sure if 'pause' is really necessary. But it sounds like it's also good for non-Hyper-Threading core.&lt;BR /&gt;&lt;BR /&gt;Thanks.&lt;BR /&gt;</description>
      <pubDate>Fri, 29 Aug 2008 17:09:32 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/memory-ordering-model/m-p/896085#M4009</guid>
      <dc:creator>tadayuki</dc:creator>
      <dc:date>2008-08-29T17:09:32Z</dc:date>
    </item>
    <item>
      <title>Re: memory ordering model</title>
      <link>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/memory-ordering-model/m-p/896086#M4010</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;DIV&gt;&lt;IMG src="https://community.intel.com/file/6745" /&gt; &lt;STRONG&gt;tadayuki:&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;BR /&gt;I see. I did know it helps Hyper-Threading but we are not using it. So I wasn't sure if 'pause' is really necessary. But it sounds like it's also good for non-Hyper-Threading core.&lt;BR /&gt;&lt;/DIV&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;I think that at least it won't worsen the situation. And official Intel guidelines says "you must use 'pause' in spin-loops". Maybe in future Intel processors 'pause' will have some additional useful consequences for non-HT.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 29 Aug 2008 17:52:20 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/memory-ordering-model/m-p/896086#M4010</guid>
      <dc:creator>Dmitry_Vyukov</dc:creator>
      <dc:date>2008-08-29T17:52:20Z</dc:date>
    </item>
  </channel>
</rss>

