<?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: N core/Linux will run N threads from &amp;quot;different&amp;quot; process? in Intel® Moderncode for Parallel Architectures</title>
    <link>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/N-core-Linux-will-run-N-threads-from-quot-different-quot-process/m-p/873140#M3081</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/327239"&gt;softarts&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;i.e.&lt;BR /&gt;N core runs Linux&lt;BR /&gt;'A' process has M threads,M &amp;gt; N&lt;BR /&gt;'B' process has M threads also&lt;BR /&gt;will N-1 threads of 'A' run on N-1 core,and the rest one runs one thread of B process?&lt;BR /&gt;&lt;BR /&gt;in this situation ,pthread_spin_lock doesn't make sense.&lt;BR /&gt;possiblity the sleeping thread of 'A' hold the resource...???&lt;/EM&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;BR /&gt;Provided that M&amp;gt;N answer to your question does not depend on OS scheduler - some process threads will always be sleeping.&lt;BR /&gt;&lt;BR /&gt;I believe that Linux (as well as Windows) scheduler may schedule basically any combinations of threads, so situation you described is perfectly possible.&lt;BR /&gt;&lt;BR /&gt;Regarding spin locks, first of all what kind of spin lock you are talking about - passive spin or active spin? Active spins make less sense in such situation, because as you said sometimes threads will be just burning CPU senselessly. Passive spins make more sense in such situation, because there will be only small overheads for threads switching, and since many of the threads yielding lock owner will be scheduled mach sooner.&lt;BR /&gt;&lt;BR /&gt;There is another moment. Spin locks have less overhead on fast-path, so probably this will cover the expenses of spinning.&lt;BR /&gt;&lt;BR /&gt;So the short answer - it depends.&lt;BR /&gt;&lt;BR /&gt;</description>
    <pubDate>Wed, 25 Mar 2009 12:59:05 GMT</pubDate>
    <dc:creator>Dmitry_Vyukov</dc:creator>
    <dc:date>2009-03-25T12:59:05Z</dc:date>
    <item>
      <title>N core/Linux will run N threads from "different" process?</title>
      <link>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/N-core-Linux-will-run-N-threads-from-quot-different-quot-process/m-p/873139#M3080</link>
      <description>i.e.&lt;BR /&gt;N core runs Linux&lt;BR /&gt;'A' process has M threads,M &amp;gt; N&lt;BR /&gt;'B' process has M threads also&lt;BR /&gt;will N-1 threads of 'A' run on N-1 core,and the rest one runs one thread of B process?&lt;BR /&gt;&lt;BR /&gt;in this situation ,pthread_spin_lock doesn't make sense.&lt;BR /&gt;possiblity the sleeping thread of 'A' hold the resource...???</description>
      <pubDate>Wed, 25 Mar 2009 10:20:59 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/N-core-Linux-will-run-N-threads-from-quot-different-quot-process/m-p/873139#M3080</guid>
      <dc:creator>softarts</dc:creator>
      <dc:date>2009-03-25T10:20:59Z</dc:date>
    </item>
    <item>
      <title>Re: N core/Linux will run N threads from "different" process?</title>
      <link>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/N-core-Linux-will-run-N-threads-from-quot-different-quot-process/m-p/873140#M3081</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/327239"&gt;softarts&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;i.e.&lt;BR /&gt;N core runs Linux&lt;BR /&gt;'A' process has M threads,M &amp;gt; N&lt;BR /&gt;'B' process has M threads also&lt;BR /&gt;will N-1 threads of 'A' run on N-1 core,and the rest one runs one thread of B process?&lt;BR /&gt;&lt;BR /&gt;in this situation ,pthread_spin_lock doesn't make sense.&lt;BR /&gt;possiblity the sleeping thread of 'A' hold the resource...???&lt;/EM&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;BR /&gt;Provided that M&amp;gt;N answer to your question does not depend on OS scheduler - some process threads will always be sleeping.&lt;BR /&gt;&lt;BR /&gt;I believe that Linux (as well as Windows) scheduler may schedule basically any combinations of threads, so situation you described is perfectly possible.&lt;BR /&gt;&lt;BR /&gt;Regarding spin locks, first of all what kind of spin lock you are talking about - passive spin or active spin? Active spins make less sense in such situation, because as you said sometimes threads will be just burning CPU senselessly. Passive spins make more sense in such situation, because there will be only small overheads for threads switching, and since many of the threads yielding lock owner will be scheduled mach sooner.&lt;BR /&gt;&lt;BR /&gt;There is another moment. Spin locks have less overhead on fast-path, so probably this will cover the expenses of spinning.&lt;BR /&gt;&lt;BR /&gt;So the short answer - it depends.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 25 Mar 2009 12:59:05 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/N-core-Linux-will-run-N-threads-from-quot-different-quot-process/m-p/873140#M3081</guid>
      <dc:creator>Dmitry_Vyukov</dc:creator>
      <dc:date>2009-03-25T12:59:05Z</dc:date>
    </item>
    <item>
      <title>Re: N core/Linux will run N threads from "different" process?</title>
      <link>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/N-core-Linux-will-run-N-threads-from-quot-different-quot-process/m-p/873141#M3082</link>
      <description>&lt;DIV style="margin:0px;"&gt;
&lt;DIV id="quote_reply" style="margin-top: 5px; width: 100%;"&gt;
&lt;DIV style="margin-left:2px;margin-right:2px;"&gt;Quoting - &lt;A href="https://community.intel.com/en-us/profile/347331"&gt;Dmitriy Vyukov&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 style="margin:0px;"&gt;&lt;/DIV&gt;
&lt;BR /&gt;Provided that M&amp;gt;N answer to your question does not depend on OS scheduler - some process threads will always be sleeping.&lt;BR /&gt;&lt;BR /&gt;I believe that Linux (as well as Windows) scheduler may schedule basically any combinations of threads, so situation you described is perfectly possible.&lt;BR /&gt;&lt;BR /&gt;Regarding spin locks, first of all what kind of spin lock you are talking about - passive spin or active spin? Active spins make less sense in such situation, because as you said sometimes threads will be just burning CPU senselessly. Passive spins make more sense in such situation, because there will be only small overheads for threads switching, and since many of the threads yielding lock owner will be scheduled mach sooner.&lt;BR /&gt;&lt;BR /&gt;There is another moment. Spin locks have less overhead on fast-path, so probably this will cover the expenses of spinning.&lt;BR /&gt;&lt;BR /&gt;So the short answer - it depends.&lt;BR /&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;BR /&gt;what's the passive spin you are talking about? seems it will cause thread switch?&lt;BR /&gt;does pthread_spin_lock in glibc have this behaviour?&lt;BR /&gt;&lt;BR /&gt;thanks!&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 08 Apr 2009 08:05:35 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/N-core-Linux-will-run-N-threads-from-quot-different-quot-process/m-p/873141#M3082</guid>
      <dc:creator>softarts</dc:creator>
      <dc:date>2009-04-08T08:05:35Z</dc:date>
    </item>
    <item>
      <title>Re: N core/Linux will run N threads from "different" process?</title>
      <link>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/N-core-Linux-will-run-N-threads-from-quot-different-quot-process/m-p/873142#M3083</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/327239"&gt;softarts&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;BR /&gt;what's the passive spin you are talking about? seems it will cause thread switch?&lt;BR /&gt;does pthread_spin_lock in glibc have this behaviour?&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;BR /&gt;&lt;BR /&gt;By passive spin I mean sched_yield/pthread_yield/SwitchToThread, i.e. when wait is propogated to the OS, however OS still does not know what thread is waiting for. Yes, it causing context switch if there are other threads which has some work to do.&lt;BR /&gt;Regarding pthread_spin_lock, I don't know. But I may conjecture that it uses some mixed technique, i.e. make active spin for some time and then switch to passive.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 09 Apr 2009 16:37:46 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/N-core-Linux-will-run-N-threads-from-quot-different-quot-process/m-p/873142#M3083</guid>
      <dc:creator>Dmitry_Vyukov</dc:creator>
      <dc:date>2009-04-09T16:37:46Z</dc:date>
    </item>
  </channel>
</rss>

