<?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 Distributed Reader-Writer Mutex 1.0 in Intel® Moderncode for Parallel Architectures</title>
    <link>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/Distributed-Reader-Writer-Mutex-1-0/m-p/991229#M6257</link>
    <description>&lt;P&gt;&lt;/P&gt;
&lt;P&gt;Hello,&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Distributed Reader-Writer Mutex 1.0&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Description:&lt;BR /&gt;&lt;BR /&gt;Distributed Reader-Writer Mutex, based on the Dmitry Vyukov&lt;BR /&gt;C++ Distributed Reader-Writer Mutex , I have included the following&lt;BR /&gt;Reader-Writer Mutexes inside this Distributed Reader-Writer mutex:&lt;BR /&gt;TOmniMREW a light weight MREW that is very fast and&lt;BR /&gt;TMultiReadExclusiveWrite from JCL and now both of them&lt;BR /&gt;can scale better, and i have modified a little bit the Dmitry Vyukov&lt;BR /&gt;Distributed Reader-Writer Mutex, i have not used GetCurrectProcessor()&lt;BR /&gt;but i have used GetCurrectThreadID() like this:&lt;BR /&gt;nbr := getcurrentthreadid mod proc_count; i have provided you&lt;BR /&gt;with the source code, please take a look at the source code to understand&lt;BR /&gt;better.&lt;BR /&gt;&lt;BR /&gt;The Object Pascal Distributed Reader-Writer Mutex 1.0&lt;BR /&gt;&amp;nbsp;is based on the following C++ Distributed Reader-Writer Mutex&lt;BR /&gt;by Dmitry Vyukov, read more here:&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://www.1024cores.net/home/lock-free-algorithms/reader-writer-problem/distributed-reader-writer-mutex"&gt;http://www.1024cores.net/home/lock-free-algorithms/reader-writer-problem/distributed-reader-writer-mutex&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;I have also modified the Dmitry Vyukov's Distributed&lt;BR /&gt;Reader-Writer Mutex&amp;nbsp; to use a variable number of MREWs,&lt;BR /&gt;you can pass the number of MREWs to the constructor like&lt;BR /&gt;this: drw:=TDRWLOCK.create(1000);&lt;BR /&gt;&lt;BR /&gt;You have four methods:&lt;BR /&gt;&lt;BR /&gt;procedure wlock; // like the EnterWriteLock of TOmniMREW&lt;BR /&gt;procedure wunlock; // like the ExitWriteLock&lt;BR /&gt;procedure rlock; // like EnterReadLock&lt;BR /&gt;procedure runlock; // like the ExitReadLock&lt;BR /&gt;&lt;BR /&gt;and you have to pass the number of MREWs(multiple-readers-exclusive-writer)&lt;BR /&gt;to the constructor like this:&lt;BR /&gt;&lt;BR /&gt;drw:=TDRWLOCK.create(1000); // here we are creating 1000 MEWs&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Language: FPC Pascal v2.2.0+ / Delphi 7+: &lt;A href="http://www.freepascal.org/"&gt;http://www.freepascal.org/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Operating Systems: Win and Linux (x86).&lt;BR /&gt;&lt;BR /&gt;Required FPC switches: -O3 -Sd -dFPC -dWin32 -dFreePascal&lt;BR /&gt;&lt;BR /&gt;-Sd for delphi mode....&lt;BR /&gt;&lt;BR /&gt;Required Delphi switches: -DMSWINDOWS -$H+&lt;BR /&gt;&lt;BR /&gt;For Delphi use -DDelphi&lt;BR /&gt;&lt;BR /&gt;And inside defines.inc you can use the following defines:&lt;BR /&gt;&lt;BR /&gt;{$DEFINE CPU32} for 32 bits systems&lt;BR /&gt;&lt;BR /&gt;{$DEFINE CPU64} for 64 bits systems&lt;BR /&gt;&lt;BR /&gt;{$DEFINE TOmniMREW} to use Omnithread MREW&lt;BR /&gt;&lt;BR /&gt;{$DEFINE TMultiReadExclusiveWrite} to use the jcl TMultiReadExclusiveWrite&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;You can download Distributed Reader-Writer Mutex 1.0 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;Thank you,&lt;BR /&gt;Amine Moulay Ramdane.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 12 Sep 2012 14:07:29 GMT</pubDate>
    <dc:creator>aminer10</dc:creator>
    <dc:date>2012-09-12T14:07:29Z</dc:date>
    <item>
      <title>Distributed Reader-Writer Mutex 1.0</title>
      <link>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/Distributed-Reader-Writer-Mutex-1-0/m-p/991229#M6257</link>
      <description>&lt;P&gt;&lt;/P&gt;
&lt;P&gt;Hello,&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Distributed Reader-Writer Mutex 1.0&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Description:&lt;BR /&gt;&lt;BR /&gt;Distributed Reader-Writer Mutex, based on the Dmitry Vyukov&lt;BR /&gt;C++ Distributed Reader-Writer Mutex , I have included the following&lt;BR /&gt;Reader-Writer Mutexes inside this Distributed Reader-Writer mutex:&lt;BR /&gt;TOmniMREW a light weight MREW that is very fast and&lt;BR /&gt;TMultiReadExclusiveWrite from JCL and now both of them&lt;BR /&gt;can scale better, and i have modified a little bit the Dmitry Vyukov&lt;BR /&gt;Distributed Reader-Writer Mutex, i have not used GetCurrectProcessor()&lt;BR /&gt;but i have used GetCurrectThreadID() like this:&lt;BR /&gt;nbr := getcurrentthreadid mod proc_count; i have provided you&lt;BR /&gt;with the source code, please take a look at the source code to understand&lt;BR /&gt;better.&lt;BR /&gt;&lt;BR /&gt;The Object Pascal Distributed Reader-Writer Mutex 1.0&lt;BR /&gt;&amp;nbsp;is based on the following C++ Distributed Reader-Writer Mutex&lt;BR /&gt;by Dmitry Vyukov, read more here:&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://www.1024cores.net/home/lock-free-algorithms/reader-writer-problem/distributed-reader-writer-mutex"&gt;http://www.1024cores.net/home/lock-free-algorithms/reader-writer-problem/distributed-reader-writer-mutex&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;I have also modified the Dmitry Vyukov's Distributed&lt;BR /&gt;Reader-Writer Mutex&amp;nbsp; to use a variable number of MREWs,&lt;BR /&gt;you can pass the number of MREWs to the constructor like&lt;BR /&gt;this: drw:=TDRWLOCK.create(1000);&lt;BR /&gt;&lt;BR /&gt;You have four methods:&lt;BR /&gt;&lt;BR /&gt;procedure wlock; // like the EnterWriteLock of TOmniMREW&lt;BR /&gt;procedure wunlock; // like the ExitWriteLock&lt;BR /&gt;procedure rlock; // like EnterReadLock&lt;BR /&gt;procedure runlock; // like the ExitReadLock&lt;BR /&gt;&lt;BR /&gt;and you have to pass the number of MREWs(multiple-readers-exclusive-writer)&lt;BR /&gt;to the constructor like this:&lt;BR /&gt;&lt;BR /&gt;drw:=TDRWLOCK.create(1000); // here we are creating 1000 MEWs&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Language: FPC Pascal v2.2.0+ / Delphi 7+: &lt;A href="http://www.freepascal.org/"&gt;http://www.freepascal.org/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Operating Systems: Win and Linux (x86).&lt;BR /&gt;&lt;BR /&gt;Required FPC switches: -O3 -Sd -dFPC -dWin32 -dFreePascal&lt;BR /&gt;&lt;BR /&gt;-Sd for delphi mode....&lt;BR /&gt;&lt;BR /&gt;Required Delphi switches: -DMSWINDOWS -$H+&lt;BR /&gt;&lt;BR /&gt;For Delphi use -DDelphi&lt;BR /&gt;&lt;BR /&gt;And inside defines.inc you can use the following defines:&lt;BR /&gt;&lt;BR /&gt;{$DEFINE CPU32} for 32 bits systems&lt;BR /&gt;&lt;BR /&gt;{$DEFINE CPU64} for 64 bits systems&lt;BR /&gt;&lt;BR /&gt;{$DEFINE TOmniMREW} to use Omnithread MREW&lt;BR /&gt;&lt;BR /&gt;{$DEFINE TMultiReadExclusiveWrite} to use the jcl TMultiReadExclusiveWrite&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;You can download Distributed Reader-Writer Mutex 1.0 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;Thank you,&lt;BR /&gt;Amine Moulay Ramdane.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 12 Sep 2012 14:07:29 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/Distributed-Reader-Writer-Mutex-1-0/m-p/991229#M6257</guid>
      <dc:creator>aminer10</dc:creator>
      <dc:date>2012-09-12T14:07:29Z</dc:date>
    </item>
  </channel>
</rss>

