<?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 Thread Pool Engine version 1.3 - stable version - is here ... in Intel® Moderncode for Parallel Architectures</title>
    <link>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/Thread-Pool-Engine-version-1-3-stable-version-is-here/m-p/860234#M2279</link>
    <description>&lt;P&gt;&lt;BR /&gt;Skybuck Flying wrote: &lt;BR /&gt;&amp;gt;I implemented my own "blocking queue" using semaphares and critical section &lt;BR /&gt;&amp;gt;(mutex). [...] &lt;BR /&gt;&lt;BR /&gt;I don't think blocking queues are as efficient as lock-free queues&lt;/P&gt;
&lt;P&gt;Just look at the difference between three lock-free algorithms&lt;/P&gt;
&lt;P&gt;&lt;A href="http://www.google.com/url?sa=D&amp;amp;q=http://pages.videotron.com/aminer/parallelqueue/parallelqueue.htm&amp;amp;usg=AFQjCNHAn1XbOSeb7dkIevtvYsvYyreiGA"&gt;&lt;SPAN style="text-decoration: underline;"&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/A&gt;&lt;A href="http://pages.videotron.com/aminer/parallelqueue/parallelqueue.htm" target="_blank"&gt;http://pages.videotron.com/aminer/parallelqueue/parallelqueue.htm&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;You can easily notice the difference between those lock-free &lt;BR /&gt;algorithmns just by setting the options in defines.inc and &lt;BR /&gt;runnning test_thread1.pas&lt;/P&gt;
&lt;P&gt;Now, just imagine what will be the difference between a &lt;BR /&gt;lock and a lock-free algorithm ? i really think lock-free &lt;BR /&gt;algorithms are very efficient.&lt;/P&gt;
&lt;P&gt;Also, i have used in my Thread Pool Engine not just one queue &lt;BR /&gt;but many lock-free queues - for each worker thread - to minimize &lt;BR /&gt;contention... and work-stealing to load balance the workload &lt;BR /&gt;efficiently...&lt;/P&gt;
&lt;P&gt;&lt;A href="http://www.google.com/url?sa=D&amp;amp;q=http://pages.videotron.com/aminer/threadpool.htm&amp;amp;usg=AFQjCNHD3ptsmr66kQziGflvDF1Kt1izcg"&gt;&lt;SPAN style="text-decoration: underline;"&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/A&gt;&lt;A href="http://pages.videotron.com/aminer/threadpool.htm" target="_blank"&gt;http://pages.videotron.com/aminer/threadpool.htm&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&amp;gt;Also your code's layout/indentation looks very bad... &lt;BR /&gt;&amp;gt;(at least some of the test programs look bad)... &lt;BR /&gt;&lt;BR /&gt;Common ! the code is not so bad..&lt;/P&gt;
&lt;P&gt;And also, i give much more importance to 'logic' than to code..&lt;/P&gt;
&lt;P&gt;&amp;gt;Also your code seems to use all kinds of external dll's/libraries... &lt;BR /&gt;&amp;gt;which is undesirable... this could also lead to security risks... &lt;BR /&gt;&amp;gt;what's inside the dll's ?!? Virus/trojans maybe ? &lt;BR /&gt;&lt;BR /&gt;I have just used the TBB memory manager in Delphi &lt;BR /&gt;- look at cmem.pas inside the zip - you can - if &lt;BR /&gt;you want - download them yourself from the intel &lt;BR /&gt;website...&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;FPC doesn't need the TBB memory manager...&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&amp;gt;Furthermore your source code uses assembler here &lt;BR /&gt;&amp;gt;and there where it might or might not be necessary... &lt;BR /&gt;&amp;gt;like "cas"... windows already have methods for &lt;BR /&gt;&amp;gt;"interlock exchange" and what not... &lt;BR /&gt;&lt;BR /&gt;I have decided to put the assembler code for educational &lt;BR /&gt;purpose also...&lt;/P&gt;
&lt;P&gt;&amp;gt;Your most interesting unit so far is the parallel hash list... &lt;BR /&gt;&amp;gt;hashes might not always be usefull though... but still it &lt;BR /&gt;&amp;gt;could be interesting. &lt;BR /&gt;&lt;BR /&gt;I also love ParallelHashList...&lt;/P&gt;
&lt;P&gt;&amp;gt;Might be a lot of work for you... so I understand if you &lt;BR /&gt;&amp;gt;don't want to do that... &lt;BR /&gt;&lt;BR /&gt;:)&lt;/P&gt;
&lt;P&gt;Amine Moulay Ramdane.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 29 Mar 2010 00:58:30 GMT</pubDate>
    <dc:creator>aminer10</dc:creator>
    <dc:date>2010-03-29T00:58:30Z</dc:date>
    <item>
      <title>Thread Pool Engine version 1.3 - stable version - is here ...</title>
      <link>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/Thread-Pool-Engine-version-1-3-stable-version-is-here/m-p/860232#M2277</link>
      <description>&lt;SPAN style="font-size: x-small;"&gt;
&lt;P&gt;&lt;BR /&gt;Hello all,&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;I have updated Threadpool to version 1.3 - a stable version -&lt;/P&gt;
&lt;P&gt;Lock-free ParallelQueuerb and lock-free RingBuffer have been added&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;Author: Amine Moulay Ramdane&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;Language: FPC Pascal v2.2.0+ / Delphi 5+:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://www.freepascal.org/" target="_blank"&gt;http://www.freepascal.org/&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;Operating Systems: Win , Linux and Mac (x86).&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;Description:&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;Lock-free Thread Pool Engine.&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;The following have been added:&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;-- Lockfree ParallelQueue for less contention and more efficiency&lt;/P&gt;
&lt;P&gt;or it can use lockfree_mpmc - flqueue that i have modified, enhanced&lt;/P&gt;
&lt;P&gt;and improved... - ...&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;- It uses a lock-free queue for each worker thread and work-stealing&lt;/P&gt;
&lt;P&gt;- for more efficiency -&lt;/P&gt;
&lt;P&gt;- The worker threads enters in a wait state when there no job in the&lt;/P&gt;
&lt;P&gt;lock-free queues - for more efficiency -&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;- You can distribute your jobs to the worker threads and call any&lt;/P&gt;
&lt;P&gt;method with the threadpool's execute() method.&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;Look into defines.inc there is many options:&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;ParallelQueue: it uses lock-free ParallelQueue - very efficient -&lt;/P&gt;
&lt;P&gt;Lockfree_MPMC: it uses lockfree_MPMC&lt;/P&gt;
&lt;P&gt;ParallelQueuerb: it uses lock-free ParallelQueuerb (New)&lt;/P&gt;
&lt;P&gt;RingBuffer: it uses lock-free RingBuffer (New)&lt;/P&gt;
&lt;P&gt;SINGLE_PRODUCER: for a single producer (thread)&lt;/P&gt;
&lt;P&gt;MUTIPLE_PRODUCER: mutiple producer (threads)&lt;/P&gt;
&lt;P&gt;CPU32: for 32 bits architecture&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;Required FPC switches: -O3 -Sd -dFPC -dWin32 -dFreePascal&lt;/P&gt;
&lt;P&gt;-Sd for delphi mode....&lt;/P&gt;
&lt;P&gt;Required Delphi switches: -DMSWINDOWS -$H+&lt;/P&gt;
&lt;P&gt;For Delphi 5,6,7 use -DDelphi&lt;/P&gt;
&lt;P&gt;For Delphi 2005,2006,2007,2009,2010+ use the switch -DDELPHI2005+&lt;/P&gt;
&lt;P&gt;Please look at the examples test.pas,test_pool.pas and&lt;/P&gt;
&lt;P&gt;test_thread.pas insode the zip...&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;Note: test_pool.pas does require Delphi 5+, test.pas and&lt;/P&gt;
&lt;P&gt;test_thread.pas works with both FreePascal and Delphi&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;You can download the new and stable version 1.3 from:&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://pages.videotron.com/aminer/" target="_blank"&gt;http://pages.videotron.com/aminer/&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;My Threadpool is VERY easy to use, and here is a page&lt;/P&gt;
&lt;P&gt;that i wrote about it:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://pages.videotron.com/aminer/threadpool.htm" target="_blank"&gt;http://pages.videotron.com/aminer/threadpool.htm&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;Sincerely,&lt;/P&gt;
&lt;P&gt;Amine Moulay Ramdane.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;/SPAN&gt;</description>
      <pubDate>Sat, 27 Mar 2010 16:56:44 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/Thread-Pool-Engine-version-1-3-stable-version-is-here/m-p/860232#M2277</guid>
      <dc:creator>aminer10</dc:creator>
      <dc:date>2010-03-27T16:56:44Z</dc:date>
    </item>
    <item>
      <title>Thread Pool Engine version 1.3 - stable version - is here ...</title>
      <link>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/Thread-Pool-Engine-version-1-3-stable-version-is-here/m-p/860233#M2278</link>
      <description>&lt;P&gt;&lt;BR /&gt;Skybuck Flying wrote:&lt;BR /&gt;&amp;gt; I would like to see performance comparisions, against &lt;BR /&gt;&amp;gt; Delphi's own TThread and/or other windows methods ?&lt;BR /&gt;&amp;gt; [...]&lt;BR /&gt;&amp;gt; and why your Thread Pool Engine would be better might also help ;)&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;And how will you load balance the workload efficiently, &lt;BR /&gt;and also minimize contention... &lt;BR /&gt;and not start threads for each job...&lt;BR /&gt;...&lt;BR /&gt;with just TThread ?&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;Please read again:&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;&lt;A href="http://pages.videotron.com/aminer/threadpool.htm"&gt;http://pages.videotron.com/aminer/threadpool.htm&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;My Threadpool is very efficient and very easy to use...&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;Take care..&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;Sincerely&lt;BR /&gt;Amine Moulay Ramdane.&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 28 Mar 2010 16:38:21 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/Thread-Pool-Engine-version-1-3-stable-version-is-here/m-p/860233#M2278</guid>
      <dc:creator>aminer10</dc:creator>
      <dc:date>2010-03-28T16:38:21Z</dc:date>
    </item>
    <item>
      <title>Thread Pool Engine version 1.3 - stable version - is here ...</title>
      <link>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/Thread-Pool-Engine-version-1-3-stable-version-is-here/m-p/860234#M2279</link>
      <description>&lt;P&gt;&lt;BR /&gt;Skybuck Flying wrote: &lt;BR /&gt;&amp;gt;I implemented my own "blocking queue" using semaphares and critical section &lt;BR /&gt;&amp;gt;(mutex). [...] &lt;BR /&gt;&lt;BR /&gt;I don't think blocking queues are as efficient as lock-free queues&lt;/P&gt;
&lt;P&gt;Just look at the difference between three lock-free algorithms&lt;/P&gt;
&lt;P&gt;&lt;A href="http://www.google.com/url?sa=D&amp;amp;q=http://pages.videotron.com/aminer/parallelqueue/parallelqueue.htm&amp;amp;usg=AFQjCNHAn1XbOSeb7dkIevtvYsvYyreiGA"&gt;&lt;SPAN style="text-decoration: underline;"&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/A&gt;&lt;A href="http://pages.videotron.com/aminer/parallelqueue/parallelqueue.htm" target="_blank"&gt;http://pages.videotron.com/aminer/parallelqueue/parallelqueue.htm&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;You can easily notice the difference between those lock-free &lt;BR /&gt;algorithmns just by setting the options in defines.inc and &lt;BR /&gt;runnning test_thread1.pas&lt;/P&gt;
&lt;P&gt;Now, just imagine what will be the difference between a &lt;BR /&gt;lock and a lock-free algorithm ? i really think lock-free &lt;BR /&gt;algorithms are very efficient.&lt;/P&gt;
&lt;P&gt;Also, i have used in my Thread Pool Engine not just one queue &lt;BR /&gt;but many lock-free queues - for each worker thread - to minimize &lt;BR /&gt;contention... and work-stealing to load balance the workload &lt;BR /&gt;efficiently...&lt;/P&gt;
&lt;P&gt;&lt;A href="http://www.google.com/url?sa=D&amp;amp;q=http://pages.videotron.com/aminer/threadpool.htm&amp;amp;usg=AFQjCNHD3ptsmr66kQziGflvDF1Kt1izcg"&gt;&lt;SPAN style="text-decoration: underline;"&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/A&gt;&lt;A href="http://pages.videotron.com/aminer/threadpool.htm" target="_blank"&gt;http://pages.videotron.com/aminer/threadpool.htm&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&amp;gt;Also your code's layout/indentation looks very bad... &lt;BR /&gt;&amp;gt;(at least some of the test programs look bad)... &lt;BR /&gt;&lt;BR /&gt;Common ! the code is not so bad..&lt;/P&gt;
&lt;P&gt;And also, i give much more importance to 'logic' than to code..&lt;/P&gt;
&lt;P&gt;&amp;gt;Also your code seems to use all kinds of external dll's/libraries... &lt;BR /&gt;&amp;gt;which is undesirable... this could also lead to security risks... &lt;BR /&gt;&amp;gt;what's inside the dll's ?!? Virus/trojans maybe ? &lt;BR /&gt;&lt;BR /&gt;I have just used the TBB memory manager in Delphi &lt;BR /&gt;- look at cmem.pas inside the zip - you can - if &lt;BR /&gt;you want - download them yourself from the intel &lt;BR /&gt;website...&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;FPC doesn't need the TBB memory manager...&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&amp;gt;Furthermore your source code uses assembler here &lt;BR /&gt;&amp;gt;and there where it might or might not be necessary... &lt;BR /&gt;&amp;gt;like "cas"... windows already have methods for &lt;BR /&gt;&amp;gt;"interlock exchange" and what not... &lt;BR /&gt;&lt;BR /&gt;I have decided to put the assembler code for educational &lt;BR /&gt;purpose also...&lt;/P&gt;
&lt;P&gt;&amp;gt;Your most interesting unit so far is the parallel hash list... &lt;BR /&gt;&amp;gt;hashes might not always be usefull though... but still it &lt;BR /&gt;&amp;gt;could be interesting. &lt;BR /&gt;&lt;BR /&gt;I also love ParallelHashList...&lt;/P&gt;
&lt;P&gt;&amp;gt;Might be a lot of work for you... so I understand if you &lt;BR /&gt;&amp;gt;don't want to do that... &lt;BR /&gt;&lt;BR /&gt;:)&lt;/P&gt;
&lt;P&gt;Amine Moulay Ramdane.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 29 Mar 2010 00:58:30 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/Thread-Pool-Engine-version-1-3-stable-version-is-here/m-p/860234#M2279</guid>
      <dc:creator>aminer10</dc:creator>
      <dc:date>2010-03-29T00:58:30Z</dc:date>
    </item>
  </channel>
</rss>

