<?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 Threadpool 1.12 ... in Intel® Moderncode for Parallel Architectures</title>
    <link>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/Threadpool-1-12/m-p/863251#M2544</link>
    <description>&lt;P&gt;&lt;BR /&gt;Hello,&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;I have patched Thradpool and to version 1.12..&lt;/P&gt;
&lt;P&gt;TPThreadPool.execute look like this - i have used an array &lt;BR /&gt;of critical sections, and a local variable 'balance'...to avoid &lt;BR /&gt;some problems...&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;------------------------------------------------------------------------------------------------------------&lt;/P&gt;
&lt;P&gt;function TPThreadPool.execute(func:TmyProc;const Context: Pointer;Priority:byte):Boolean; &lt;BR /&gt;var&lt;BR /&gt;params: MyParam;&lt;BR /&gt;balance:integer;&lt;BR /&gt;begin&lt;BR /&gt;//new(params);&lt;BR /&gt;params:=MYParam.create;&lt;BR /&gt;params.proc:=func;&lt;BR /&gt;params.param:=context;&lt;BR /&gt;balance:=LockedInc(balance1);&lt;BR /&gt;if (balance=FThreadCount) then &lt;BR /&gt; begin&lt;BR /&gt; LockedSub(balance,balance); &lt;BR /&gt; LockedSub(balance1,balance1); &lt;BR /&gt; end;&lt;BR /&gt; &lt;BR /&gt;cs[balance].enter; &lt;BR /&gt;while not Queues[balance].push(TObject(params),priority) do;&lt;BR /&gt;if Queues[balance].count&amp;lt;=1 then events[balance].setevent;&lt;BR /&gt;cs[balance].leave; &lt;BR /&gt;end;&lt;BR /&gt;-----------------------------------------------------------------------------------------&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;Threadpool with priority have been updated also to 1.12&lt;/P&gt;
&lt;P&gt;You can download Threadpool version 1.12 from:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://pages.videotron.com/aminer/"&gt;http://pages.videotron.com/aminer/&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;Thank you for your time..&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;Amine Moulay Ramdane.&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 24 Mar 2010 08:42:37 GMT</pubDate>
    <dc:creator>aminer10</dc:creator>
    <dc:date>2010-03-24T08:42:37Z</dc:date>
    <item>
      <title>Threadpool 1.12 ...</title>
      <link>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/Threadpool-1-12/m-p/863251#M2544</link>
      <description>&lt;P&gt;&lt;BR /&gt;Hello,&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;I have patched Thradpool and to version 1.12..&lt;/P&gt;
&lt;P&gt;TPThreadPool.execute look like this - i have used an array &lt;BR /&gt;of critical sections, and a local variable 'balance'...to avoid &lt;BR /&gt;some problems...&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;------------------------------------------------------------------------------------------------------------&lt;/P&gt;
&lt;P&gt;function TPThreadPool.execute(func:TmyProc;const Context: Pointer;Priority:byte):Boolean; &lt;BR /&gt;var&lt;BR /&gt;params: MyParam;&lt;BR /&gt;balance:integer;&lt;BR /&gt;begin&lt;BR /&gt;//new(params);&lt;BR /&gt;params:=MYParam.create;&lt;BR /&gt;params.proc:=func;&lt;BR /&gt;params.param:=context;&lt;BR /&gt;balance:=LockedInc(balance1);&lt;BR /&gt;if (balance=FThreadCount) then &lt;BR /&gt; begin&lt;BR /&gt; LockedSub(balance,balance); &lt;BR /&gt; LockedSub(balance1,balance1); &lt;BR /&gt; end;&lt;BR /&gt; &lt;BR /&gt;cs[balance].enter; &lt;BR /&gt;while not Queues[balance].push(TObject(params),priority) do;&lt;BR /&gt;if Queues[balance].count&amp;lt;=1 then events[balance].setevent;&lt;BR /&gt;cs[balance].leave; &lt;BR /&gt;end;&lt;BR /&gt;-----------------------------------------------------------------------------------------&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;Threadpool with priority have been updated also to 1.12&lt;/P&gt;
&lt;P&gt;You can download Threadpool version 1.12 from:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://pages.videotron.com/aminer/"&gt;http://pages.videotron.com/aminer/&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;Thank you for your time..&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;Amine Moulay Ramdane.&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 24 Mar 2010 08:42:37 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/Threadpool-1-12/m-p/863251#M2544</guid>
      <dc:creator>aminer10</dc:creator>
      <dc:date>2010-03-24T08:42:37Z</dc:date>
    </item>
  </channel>
</rss>

