<?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  CAS operations and scalability... in Intel® Moderncode for Parallel Architectures</title>
    <link>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/CAS-operations-and-scalability/m-p/994084#M6334</link>
    <description>&lt;BR /&gt;Hello,&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;When the CAS operation "goes on the bus", use of CAS can 
impair scalability.&lt;BR /&gt;but CAS can be accomplished locally -- that is, with no 
bus transactions --&lt;BR /&gt;and then it can scale.&lt;BR /&gt;&lt;BR /&gt;If we then change the CAS 
operation that goes on the bus to a normal store&lt;BR /&gt;you'll also see a similar 
slow-down in terms of coherency bus traffic, CAS&lt;BR /&gt;isn't appreciably different 
than a normal store. Also the lock: prefix &lt;BR /&gt;caused&lt;BR /&gt;the LOCK# signal to be 
asserted, acquiring exclusive access to the bus.&lt;BR /&gt;This doesn't scale of 
course&lt;BR /&gt;&lt;BR /&gt;As you have noticed i&amp;nbsp; have wrote parallelhashlist (a parallel 
hashtable),&lt;BR /&gt;you can find parallelhashlist here:&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://pages.videotron.com/aminer/"&gt;http://pages.videotron.com/aminer/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;It's 
a parallel Hashtable with O(1) best case and O(log(n)) worst case&lt;BR /&gt;access that 
uses lock striping and lightweight MREWs(multiple-readers&lt;BR /&gt;-exclusive-writer) 
, this allows multiple threads to write and read&lt;BR /&gt;concurently. also 
parallelhashlist maintains an independant counter , that&lt;BR /&gt;counts the number of 
entries , for each segment of the hashtable and uses&lt;BR /&gt;a lock for each counter, 
this is also for better scalability. and &lt;BR /&gt;parallelhashlist&lt;BR /&gt;is scaling very 
well,&amp;nbsp; but since it is a parallel hashtable so the &lt;BR /&gt;possibility 
of&lt;BR /&gt;contention is low so why doi need the distributed reader-writer lock 
of&lt;BR /&gt;Dmitry Vyukov inside my parallel hashlist ?&lt;BR /&gt;&lt;BR /&gt;Other than that I have 
done some tests with the lightweight MREW that i am&lt;BR /&gt;using inside my 
parallelhashlist and i have done also some tests with my&lt;BR /&gt;lockfree mpmc fifo 
queue and what i think is that the CAS is generating&lt;BR /&gt;a lot of contention this 
is is why the lightweight MREW and my lockfree_mpmc&lt;BR /&gt;are not scaling , but 
parallelhashlist is scaling very well cause i am using&lt;BR /&gt;lock-striping that is 
lowering contention.&lt;BR /&gt;&lt;BR /&gt;What are doing Dmitry Vyukov in his distributed 
rwlock is lowering&lt;BR /&gt;the contention using the same method as lock striping that 
i am using inside&lt;BR /&gt;parallelhashlist it is why it is scaling, but there is 
still a possibility&lt;BR /&gt;of contention in his distributed rwlock that can cause a 
problem to the&lt;BR /&gt;scalability if there is too many threads and not a sufficient 
number of&lt;BR /&gt;rwlocks in the Dmitry distributed rwlock to be able to lower the 
contention.&lt;BR /&gt;&lt;BR /&gt;I have tested parallelhashlist(a parallel hashtable that i 
have implemented)&lt;BR /&gt;with four threads on a quad core and it's giving a very 
well scaling on both&lt;BR /&gt;reads and writes.&lt;BR /&gt;&lt;BR /&gt;Also i have done some 
scalability tests on my parallelsort library and i &lt;BR /&gt;have&lt;BR /&gt;come&lt;BR /&gt;to the 
conclusion that parallel heapsort is better on scalability than&lt;BR /&gt;parallel 
quicksort&lt;BR /&gt;cause the P part (of the Amdahl equation) is bigger in parallel 
heapsort&lt;BR /&gt;than in parallel&lt;BR /&gt;quicksort, the parallel heapsort is doing more 
on the parallel part, it's&lt;BR /&gt;why it scales better than parallel quicksort, but 
parallel quicksort is&lt;BR /&gt;still&lt;BR /&gt;faster than parallel heapsort and parallel 
merge sort on my tests on a&lt;BR /&gt;quad core processor.&lt;BR /&gt;&lt;BR /&gt;And about 
lockfree_mpmc( a lockfree fifo queue), i have done some tests&lt;BR /&gt;and it's not 
scaling cause when you are using a single thread some variables&lt;BR /&gt;are updated 
locally on the L1 cache but using multiple threads those &lt;BR /&gt;variables 
are&lt;BR /&gt;loaded from the L2 cache and it's more expensive to load them from the 
L2&lt;BR /&gt;cache.and this does generate much more contention&lt;BR /&gt;&lt;BR /&gt;But even though 
lockfree_mpmc is not scalable, you can increase&lt;BR /&gt;the P (parallel) part by 
doing more of the same: Increase the volume of&lt;BR /&gt;data processed by the P part 
(and therefore the percentage p of time spent&lt;BR /&gt;in computing). This is 
Gustafson's Law and you will get more scalability.&lt;BR /&gt;&lt;BR /&gt;For example i have 
used the IntToStr() function on each of the four threads&lt;BR /&gt;(on&lt;BR /&gt;a quad core) 
on my lockfree_mpmc test programs to convert from and integer&lt;BR /&gt;to a string, so 
i have increased the P (parallel) part and i have got 
more&lt;BR /&gt;scalability,&lt;BR /&gt;this is Gustafson's Law, and you have to remember 
Gustafson's Law ,&lt;BR /&gt;this is very important.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;You can download my 
parallel libraries from&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://pages.videotron.com/aminer/"&gt;http://pages.videotron.com/aminer/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Sincerely,&lt;BR /&gt;Amine 
Moulay Ramdane.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
    <pubDate>Sun, 26 Aug 2012 16:45:30 GMT</pubDate>
    <dc:creator>aminer10</dc:creator>
    <dc:date>2012-08-26T16:45:30Z</dc:date>
    <item>
      <title>CAS operations and scalability...</title>
      <link>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/CAS-operations-and-scalability/m-p/994084#M6334</link>
      <description>&lt;BR /&gt;Hello,&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;When the CAS operation "goes on the bus", use of CAS can 
impair scalability.&lt;BR /&gt;but CAS can be accomplished locally -- that is, with no 
bus transactions --&lt;BR /&gt;and then it can scale.&lt;BR /&gt;&lt;BR /&gt;If we then change the CAS 
operation that goes on the bus to a normal store&lt;BR /&gt;you'll also see a similar 
slow-down in terms of coherency bus traffic, CAS&lt;BR /&gt;isn't appreciably different 
than a normal store. Also the lock: prefix &lt;BR /&gt;caused&lt;BR /&gt;the LOCK# signal to be 
asserted, acquiring exclusive access to the bus.&lt;BR /&gt;This doesn't scale of 
course&lt;BR /&gt;&lt;BR /&gt;As you have noticed i&amp;nbsp; have wrote parallelhashlist (a parallel 
hashtable),&lt;BR /&gt;you can find parallelhashlist here:&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://pages.videotron.com/aminer/"&gt;http://pages.videotron.com/aminer/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;It's 
a parallel Hashtable with O(1) best case and O(log(n)) worst case&lt;BR /&gt;access that 
uses lock striping and lightweight MREWs(multiple-readers&lt;BR /&gt;-exclusive-writer) 
, this allows multiple threads to write and read&lt;BR /&gt;concurently. also 
parallelhashlist maintains an independant counter , that&lt;BR /&gt;counts the number of 
entries , for each segment of the hashtable and uses&lt;BR /&gt;a lock for each counter, 
this is also for better scalability. and &lt;BR /&gt;parallelhashlist&lt;BR /&gt;is scaling very 
well,&amp;nbsp; but since it is a parallel hashtable so the &lt;BR /&gt;possibility 
of&lt;BR /&gt;contention is low so why doi need the distributed reader-writer lock 
of&lt;BR /&gt;Dmitry Vyukov inside my parallel hashlist ?&lt;BR /&gt;&lt;BR /&gt;Other than that I have 
done some tests with the lightweight MREW that i am&lt;BR /&gt;using inside my 
parallelhashlist and i have done also some tests with my&lt;BR /&gt;lockfree mpmc fifo 
queue and what i think is that the CAS is generating&lt;BR /&gt;a lot of contention this 
is is why the lightweight MREW and my lockfree_mpmc&lt;BR /&gt;are not scaling , but 
parallelhashlist is scaling very well cause i am using&lt;BR /&gt;lock-striping that is 
lowering contention.&lt;BR /&gt;&lt;BR /&gt;What are doing Dmitry Vyukov in his distributed 
rwlock is lowering&lt;BR /&gt;the contention using the same method as lock striping that 
i am using inside&lt;BR /&gt;parallelhashlist it is why it is scaling, but there is 
still a possibility&lt;BR /&gt;of contention in his distributed rwlock that can cause a 
problem to the&lt;BR /&gt;scalability if there is too many threads and not a sufficient 
number of&lt;BR /&gt;rwlocks in the Dmitry distributed rwlock to be able to lower the 
contention.&lt;BR /&gt;&lt;BR /&gt;I have tested parallelhashlist(a parallel hashtable that i 
have implemented)&lt;BR /&gt;with four threads on a quad core and it's giving a very 
well scaling on both&lt;BR /&gt;reads and writes.&lt;BR /&gt;&lt;BR /&gt;Also i have done some 
scalability tests on my parallelsort library and i &lt;BR /&gt;have&lt;BR /&gt;come&lt;BR /&gt;to the 
conclusion that parallel heapsort is better on scalability than&lt;BR /&gt;parallel 
quicksort&lt;BR /&gt;cause the P part (of the Amdahl equation) is bigger in parallel 
heapsort&lt;BR /&gt;than in parallel&lt;BR /&gt;quicksort, the parallel heapsort is doing more 
on the parallel part, it's&lt;BR /&gt;why it scales better than parallel quicksort, but 
parallel quicksort is&lt;BR /&gt;still&lt;BR /&gt;faster than parallel heapsort and parallel 
merge sort on my tests on a&lt;BR /&gt;quad core processor.&lt;BR /&gt;&lt;BR /&gt;And about 
lockfree_mpmc( a lockfree fifo queue), i have done some tests&lt;BR /&gt;and it's not 
scaling cause when you are using a single thread some variables&lt;BR /&gt;are updated 
locally on the L1 cache but using multiple threads those &lt;BR /&gt;variables 
are&lt;BR /&gt;loaded from the L2 cache and it's more expensive to load them from the 
L2&lt;BR /&gt;cache.and this does generate much more contention&lt;BR /&gt;&lt;BR /&gt;But even though 
lockfree_mpmc is not scalable, you can increase&lt;BR /&gt;the P (parallel) part by 
doing more of the same: Increase the volume of&lt;BR /&gt;data processed by the P part 
(and therefore the percentage p of time spent&lt;BR /&gt;in computing). This is 
Gustafson's Law and you will get more scalability.&lt;BR /&gt;&lt;BR /&gt;For example i have 
used the IntToStr() function on each of the four threads&lt;BR /&gt;(on&lt;BR /&gt;a quad core) 
on my lockfree_mpmc test programs to convert from and integer&lt;BR /&gt;to a string, so 
i have increased the P (parallel) part and i have got 
more&lt;BR /&gt;scalability,&lt;BR /&gt;this is Gustafson's Law, and you have to remember 
Gustafson's Law ,&lt;BR /&gt;this is very important.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;You can download my 
parallel libraries from&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://pages.videotron.com/aminer/"&gt;http://pages.videotron.com/aminer/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Sincerely,&lt;BR /&gt;Amine 
Moulay Ramdane.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Sun, 26 Aug 2012 16:45:30 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/CAS-operations-and-scalability/m-p/994084#M6334</guid>
      <dc:creator>aminer10</dc:creator>
      <dc:date>2012-08-26T16:45:30Z</dc:date>
    </item>
  </channel>
</rss>

