<?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 Checking Against Other Memory Models (x86, PPC, Java, CLI) in Intel® Moderncode for Parallel Architectures</title>
    <link>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/Synchronization-Algorithm-Verificator-for-C-0x/m-p/847367#M1736</link>
    <description>Q: Can I use Relacy Race Detector to check my algo againts other that C++0x memory models (x86, PPC, Java, CLI)?&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
A Yes, you can. Fortunately, C++0x memory model is very relaxaed, so
for the main part it's a "superset" of basically any other memory
model. You just have to define "binding" between your target memory
model and C++0x memory model.&lt;BR /&gt;
&lt;BR /&gt;
Let's create such binding, for example, for x86 memory model:&lt;BR /&gt;
- plain load operation is always "acquire" (i.e. memory_order_acquire)&lt;BR /&gt;
- plain store operation is always "release" (i.e. memory_order_release)&lt;BR /&gt;
- atomic RMW operation is always sequentially consistent (i.e. memory_order_seq_cst)&lt;BR /&gt;
- mfence instruction is std::atomic_thread_fence(memory_order_seq_cst)&lt;BR /&gt;
That is all. You can create such bindings for other hardware memory models you are interested in (PPC, Itatium, SPARC etc).&lt;BR /&gt;
&lt;BR /&gt;
And you can define such binding to other abstract memory model, like Java MM. Let's see:&lt;BR /&gt;
- plain load is "relaxed" (i.e. memory_order_relaxed)&lt;BR /&gt;
- plain store is "relaxed" (i.e. memory_order_relaxed)&lt;BR /&gt;
- volatile load is "acquire" (i.e. memory_order_acquire)&lt;BR /&gt;
- volatile store operation is "release" (i.e. memory_order_release)&lt;BR /&gt;
- atomic RMW operation is always sequentially consistent (i.e. memory_order_seq_cst)&lt;BR /&gt;
But here are some caveats. First, you have to emulate work of GC, i.e.
put all allocated memory to special list, and free all allocated memory
in test_suite::after(). Second, you have to manually emit sequentially
consistent memory fence between every volatile store and volatile load.
Third, you have to manually initialize all variables to default value
(0). Fourth, there is no such thing as data race, so you have to define
all variables as std::atomic, this will effectively disable data race
detection mechanizm. Well, actually you can use rl::var variables, if
you know that there must be no concurrent accesses to variable, this
will enable some automatic error detection wrt data races.&lt;BR /&gt;
Sounds not very cool... So I'm going to add built-in support for Java
and CLI. Then user would have to define something like
RL_JAVA_MODE/RL_CLI_MODE, and get all those things out-of-the-box. But
yes, it still will be C++ library. What do you think?&lt;BR /&gt;
&lt;BR /&gt;
Dmitriy V'jukov</description>
    <pubDate>Sun, 03 Aug 2008 12:25:37 GMT</pubDate>
    <dc:creator>Dmitry_Vyukov</dc:creator>
    <dc:date>2008-08-03T12:25:37Z</dc:date>
    <item>
      <title>Synchronization Algorithm Verificator for C++0x</title>
      <link>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/Synchronization-Algorithm-Verificator-for-C-0x/m-p/847366#M1735</link>
      <description>I want to announce tool
called Relacy Race Detector, which I've developed. It's
synchronization algorithm verificator for C++0x's relaxed memory
model. The tool is implemented in the form of header-only library for
C++03, which can be used for efficient execution of unit-tests for
synchronization algorithms. The tool executes unit-test many times
under control of special scheduler, on every execution scheduler
models different interleaving between threads, at the same time every
execution is exhaustively analyzed for data races, accesses to freed
memory, failed assertions etc. If no errors found then verification
terminates when particular number of interleavings are verified (for
random scheduler), or when all possible interleavings are verified
(for full search scheduler). If error is found then tool outputs
detailed execution history which leads to error and terminates.
&lt;P&gt;The tool was designed for
verification of algorithms like memory management, memory reclamation
for lock-free algorithms, multithreaded containers (queues, stacks,
maps), mutexes, eventcounts and so on.&lt;/P&gt;
&lt;P&gt;My personal subjective
feeling to date is that tool is capable of finding extremely subtle
algorithmic errors, memory fence placement errors and memory fence
type errors within a second. And after error is detected error fixing
is relatively trivial, because one has detailed execution history
which leads to error.  
&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;
&lt;/P&gt;
&lt;P&gt;Main features:&lt;/P&gt;
&lt;P&gt; - Relaxed ISO C++0x
Memory Model. Relaxed/acquire/release/acq_rel/seq_cst memory
operations and fences. The only non-supported feature is
memory_order_consume, it's simulated with memory_order_acquire.&lt;/P&gt;
&lt;P&gt; - Exhaustive automatic
error checking (including ABA detection).&lt;/P&gt;
&lt;P&gt; - Full-fledged atomics
library (with spurious failures in compare_exchange()).&lt;/P&gt;
&lt;P&gt; - Arbitrary number of
threads.&lt;/P&gt;
&lt;P&gt; - Detailed execution
history for failed tests.&lt;/P&gt;
&lt;P&gt; - Before/after/invariant
functions for test suites.&lt;/P&gt;
&lt;P&gt; - No false positives.&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;
&lt;/P&gt;
&lt;P&gt;Types of detectable
errors:&lt;/P&gt;
&lt;P&gt; - Race condition
(according to ISO C++0x definition)&lt;/P&gt;
&lt;P&gt; - Access to uninitialized
variable&lt;/P&gt;
&lt;P&gt; - Access to freed memory&lt;/P&gt;
&lt;P&gt; - Double free&lt;/P&gt;
&lt;P&gt; - Memory leak&lt;/P&gt;
&lt;P&gt; - Deadlock&lt;/P&gt;
&lt;P&gt; - Livelock&lt;/P&gt;
&lt;P&gt; - User assert failed&lt;/P&gt;
&lt;P&gt; - User invariant failed&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;
&lt;/P&gt;
&lt;P&gt;You can get some more
information (tutorial, examples etc) here:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://groups.google.com/group/relacy/web"&gt;http://groups.google.com/group/relacy/web&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;
&lt;/P&gt;
&lt;P&gt;And here is dedicated news
group/discussion forum:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://groups.google.com/group/relacy/topics"&gt;http://groups.google.com/group/relacy/topics&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;
&lt;/P&gt;
&lt;P&gt;If you want to get a copy
of the tool, please, contact me via &lt;A href="mailto:dvyukov@gmail.com"&gt;dvyukov@gmail.com&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;
&lt;/P&gt;
&lt;P&gt;Any feedback, comments,
suggestions are welcome.&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;
&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Relacy Race Detector
is free for open-source, non-commercial development; &lt;/SPAN&gt;research
with non-patented, published results; &lt;SPAN&gt;educational
purposes; home/private usage. Please contact me (&lt;A href="mailto:dvyukov@gmail.com"&gt;dvyukov@gmail.com&lt;/A&gt;)
about other usages.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;
&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;
&lt;/P&gt;
&lt;P&gt;--------------------------------------------------------&lt;/P&gt;
&lt;P&gt;Here is quick example.&lt;/P&gt;
&lt;P&gt;Code of unit-test:&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;
&lt;/P&gt;
&lt;PRE&gt;#include &lt;RELAC y=""&gt;&lt;/RELAC&gt;&lt;/PRE&gt;

&lt;PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/PRE&gt;

&lt;PRE&gt;// template parameter '2' is number of threads&lt;/PRE&gt;

&lt;PRE&gt;struct race_test : rl::test_suite&lt;RACE_TEST&gt;&lt;/RACE_TEST&gt;&lt;/PRE&gt;

&lt;PRE&gt;{&lt;/PRE&gt;

&lt;PRE&gt;    std::atomic&lt;INT&gt; a;&lt;/INT&gt;&lt;/PRE&gt;

&lt;PRE&gt;    rl::var&lt;INT&gt; x;&lt;/INT&gt;&lt;/PRE&gt;

&lt;PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/PRE&gt;

&lt;PRE&gt;    // executed in single thread before main thread function&lt;/PRE&gt;

&lt;PRE&gt;    void before()&lt;/PRE&gt;

&lt;PRE&gt;    {&lt;/PRE&gt;

&lt;PRE&gt;        a($) = 0;&lt;/PRE&gt;

&lt;PRE&gt;        x($) = 0;&lt;/PRE&gt;

&lt;PRE&gt;    }&lt;/PRE&gt;

&lt;PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/PRE&gt;

&lt;PRE&gt;    // main thread function&lt;/PRE&gt;

&lt;PRE&gt;    void thread(unsigned thread_index)&lt;/PRE&gt;

&lt;PRE&gt;    {&lt;/PRE&gt;

&lt;PRE&gt;        if (0 == thread_index)&lt;/PRE&gt;

&lt;PRE&gt;        {&lt;/PRE&gt;

&lt;PRE&gt;            // code executed by first thread&lt;/PRE&gt;

&lt;PRE&gt;            x($) = 1;&lt;/PRE&gt;

&lt;PRE&gt;            a($).store(1, rl::memory_order_relaxed);&lt;/PRE&gt;

&lt;PRE&gt;        }&lt;/PRE&gt;

&lt;PRE&gt;        else&lt;/PRE&gt;

&lt;PRE&gt;        {&lt;/PRE&gt;

&lt;PRE&gt;            // code executed by second thread&lt;/PRE&gt;

&lt;PRE&gt;            if (1 == a($).load(rl::memory_order_relaxed))&lt;/PRE&gt;

&lt;PRE&gt;                x($) = 2;&lt;/PRE&gt;

&lt;PRE&gt;        }&lt;/PRE&gt;

&lt;PRE&gt;    }&lt;/PRE&gt;

&lt;PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/PRE&gt;

&lt;PRE&gt;    // executed in single thread after main thread function&lt;/PRE&gt;

&lt;PRE&gt;    void after()&lt;/PRE&gt;

&lt;PRE&gt;    {&lt;/PRE&gt;

&lt;PRE&gt;    }&lt;/PRE&gt;

&lt;PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/PRE&gt;

&lt;PRE&gt;    // executed in single thread after every&lt;/PRE&gt;

&lt;PRE&gt;    // 'visible' action in main threads.&lt;/PRE&gt;

&lt;PRE&gt;    // disallowed to modify any state&lt;/PRE&gt;

&lt;PRE&gt;    void invariant()&lt;/PRE&gt;

&lt;PRE&gt;    {&lt;/PRE&gt;

&lt;PRE&gt;    }&lt;/PRE&gt;

&lt;PRE&gt;};&lt;/PRE&gt;

&lt;PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/PRE&gt;

&lt;PRE&gt;int main()&lt;/PRE&gt;

&lt;PRE&gt;{&lt;/PRE&gt;

&lt;PRE&gt;    // start simulation&lt;/PRE&gt;

&lt;PRE&gt;    rl::simulate&lt;RACE_TEST&gt;();&lt;/RACE_TEST&gt;&lt;/PRE&gt;

&lt;PRE&gt;}&lt;/PRE&gt;

&lt;PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/PRE&gt;

&lt;P&gt;And here is output of the
tool:&lt;/P&gt;

&lt;P&gt;&lt;FONT color="#000000" size="2"&gt;&lt;FONT face="courier new, monospace"&gt;struct
race_test&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size="2"&gt;&lt;BR /&gt;
&lt;/FONT&gt;&lt;FONT color="#000000" size="2"&gt;&lt;FONT face="courier new, monospace"&gt;DATA
RACE&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size="2"&gt;&lt;BR /&gt;
&lt;/FONT&gt;&lt;FONT color="#000000" size="2"&gt;&lt;FONT face="courier new, monospace"&gt;iteration:
8&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size="2"&gt;&lt;BR /&gt;
&lt;BR /&gt;
&lt;/FONT&gt;&lt;FONT color="#000000" size="2"&gt;&lt;FONT face="courier new, monospace"&gt;execution
history:&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size="2"&gt;&lt;BR /&gt;
&lt;/FONT&gt;&lt;FONT color="#000000" size="2"&gt;&lt;FONT face="courier new, monospace"&gt;[0]
0: &amp;lt;00366538&amp;gt; atomic store, value=0, (prev value=0),
order=seq_cst, in race_test::before, test.cpp(14)&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size="2"&gt;&lt;BR /&gt;
&lt;/FONT&gt;&lt;FONT color="#000000" size="2"&gt;&lt;FONT face="courier new, monospace"&gt;[1]
0: &amp;lt;0036655C&amp;gt; store, value=0, in race_test::before,
test.cpp(15)&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size="2"&gt;&lt;BR /&gt;
&lt;/FONT&gt;&lt;FONT color="#000000" size="2"&gt;&lt;FONT face="courier new, monospace"&gt;[2]
0: &amp;lt;0036655C&amp;gt; store, value=1, in race_test::thread,
test.cpp(23)&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size="2"&gt;&lt;BR /&gt;
&lt;/FONT&gt;&lt;FONT color="#000000" size="2"&gt;&lt;FONT face="courier new, monospace"&gt;[3]
0: &amp;lt;00366538&amp;gt; atomic store, value=1, (prev value=0),
order=relaxed, in race_test::thread, test.cpp(24)&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size="2"&gt;&lt;BR /&gt;
&lt;/FONT&gt;&lt;FONT color="#000000" size="2"&gt;&lt;FONT face="courier new, monospace"&gt;[4]
1: &amp;lt;00366538&amp;gt; atomic load, value=1, order=relaxed, in
race_test::thread, test.cpp(28)&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size="2"&gt;&lt;BR /&gt;
&lt;/FONT&gt;&lt;FONT color="#000000" size="2"&gt;&lt;FONT face="courier new, monospace"&gt;[5]
1: &amp;lt;0036655C&amp;gt; store, value=0, in rac
e_test::thread,
test.cpp(29)&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size="2"&gt;&lt;BR /&gt;
&lt;/FONT&gt;&lt;FONT color="#000000" size="2"&gt;&lt;FONT face="courier new, monospace"&gt;[6]
1: data race detected, in race_test::thread, test.cpp(29)&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size="2"&gt;&lt;BR /&gt;
&lt;BR /&gt;
&lt;/FONT&gt;&lt;FONT color="#000000" size="2"&gt;&lt;FONT face="courier new, monospace"&gt;thread
0:&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size="2"&gt;&lt;BR /&gt;
&lt;/FONT&gt;&lt;FONT color="#000000" size="2"&gt;&lt;FONT face="courier new, monospace"&gt;[0]
0: &amp;lt;00366538&amp;gt; atomic store, value=0, (prev value=0),
order=seq_cst, in race_test::before, test.cpp(14)&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size="2"&gt;&lt;BR /&gt;
&lt;/FONT&gt;&lt;FONT color="#000000" size="2"&gt;&lt;FONT face="courier new, monospace"&gt;[1]
0: &amp;lt;0036655C&amp;gt; store, value=0, in race_test::before,
test.cpp(15)&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size="2"&gt;&lt;BR /&gt;
&lt;/FONT&gt;&lt;FONT color="#000000" size="2"&gt;&lt;FONT face="courier new, monospace"&gt;[2]
0: &amp;lt;0036655C&amp;gt; store, value=1, in race_test::thread,
test.cpp(23)&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size="2"&gt;&lt;BR /&gt;
&lt;/FONT&gt;&lt;FONT color="#000000" size="2"&gt;&lt;FONT face="courier new, monospace"&gt;[3]
0: &amp;lt;00366538&amp;gt; atomic store, value=1, (prev value=0),
order=relaxed, in race_test::thread, test.cpp(24)&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size="2"&gt;&lt;BR /&gt;
&lt;BR /&gt;
&lt;/FONT&gt;&lt;FONT color="#000000" size="2"&gt;&lt;FONT face="courier new, monospace"&gt;thread
1:&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size="2"&gt;&lt;BR /&gt;
&lt;/FONT&gt;&lt;FONT color="#000000" size="2"&gt;&lt;FONT face="courier new, monospace"&gt;[4]
1: &amp;lt;00366538&amp;gt; atomic load, value=1, order=relaxed, in
race_test::thread, test.cpp(28)&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size="2"&gt;&lt;BR /&gt;
&lt;/FONT&gt;&lt;FONT color="#000000" size="2"&gt;&lt;FONT face="courier new, monospace"&gt;[5]
1: &amp;lt;0036655C&amp;gt; store, value=0, in race_test::thread,
test.cpp(29)&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size="2"&gt;&lt;BR /&gt;
&lt;/FONT&gt;&lt;FONT color="#000000" size="2"&gt;&lt;FONT face="courier new, monospace"&gt;[6]
1: data race detected, in race_test::thread, test.cpp(29)&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="2"&gt;--------------------------------------------------------&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;
&lt;/P&gt;

&lt;P&gt;Dmitriy V'jukov
&lt;/P&gt;</description>
      <pubDate>Sun, 03 Aug 2008 07:54:57 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/Synchronization-Algorithm-Verificator-for-C-0x/m-p/847366#M1735</guid>
      <dc:creator>Dmitry_Vyukov</dc:creator>
      <dc:date>2008-08-03T07:54:57Z</dc:date>
    </item>
    <item>
      <title>Checking Against Other Memory Models (x86, PPC, Java, CLI)</title>
      <link>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/Synchronization-Algorithm-Verificator-for-C-0x/m-p/847367#M1736</link>
      <description>Q: Can I use Relacy Race Detector to check my algo againts other that C++0x memory models (x86, PPC, Java, CLI)?&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
A Yes, you can. Fortunately, C++0x memory model is very relaxaed, so
for the main part it's a "superset" of basically any other memory
model. You just have to define "binding" between your target memory
model and C++0x memory model.&lt;BR /&gt;
&lt;BR /&gt;
Let's create such binding, for example, for x86 memory model:&lt;BR /&gt;
- plain load operation is always "acquire" (i.e. memory_order_acquire)&lt;BR /&gt;
- plain store operation is always "release" (i.e. memory_order_release)&lt;BR /&gt;
- atomic RMW operation is always sequentially consistent (i.e. memory_order_seq_cst)&lt;BR /&gt;
- mfence instruction is std::atomic_thread_fence(memory_order_seq_cst)&lt;BR /&gt;
That is all. You can create such bindings for other hardware memory models you are interested in (PPC, Itatium, SPARC etc).&lt;BR /&gt;
&lt;BR /&gt;
And you can define such binding to other abstract memory model, like Java MM. Let's see:&lt;BR /&gt;
- plain load is "relaxed" (i.e. memory_order_relaxed)&lt;BR /&gt;
- plain store is "relaxed" (i.e. memory_order_relaxed)&lt;BR /&gt;
- volatile load is "acquire" (i.e. memory_order_acquire)&lt;BR /&gt;
- volatile store operation is "release" (i.e. memory_order_release)&lt;BR /&gt;
- atomic RMW operation is always sequentially consistent (i.e. memory_order_seq_cst)&lt;BR /&gt;
But here are some caveats. First, you have to emulate work of GC, i.e.
put all allocated memory to special list, and free all allocated memory
in test_suite::after(). Second, you have to manually emit sequentially
consistent memory fence between every volatile store and volatile load.
Third, you have to manually initialize all variables to default value
(0). Fourth, there is no such thing as data race, so you have to define
all variables as std::atomic, this will effectively disable data race
detection mechanizm. Well, actually you can use rl::var variables, if
you know that there must be no concurrent accesses to variable, this
will enable some automatic error detection wrt data races.&lt;BR /&gt;
Sounds not very cool... So I'm going to add built-in support for Java
and CLI. Then user would have to define something like
RL_JAVA_MODE/RL_CLI_MODE, and get all those things out-of-the-box. But
yes, it still will be C++ library. What do you think?&lt;BR /&gt;
&lt;BR /&gt;
Dmitriy V'jukov</description>
      <pubDate>Sun, 03 Aug 2008 12:25:37 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/Synchronization-Algorithm-Verificator-for-C-0x/m-p/847367#M1736</guid>
      <dc:creator>Dmitry_Vyukov</dc:creator>
      <dc:date>2008-08-03T12:25:37Z</dc:date>
    </item>
    <item>
      <title>Relacy v1.1</title>
      <link>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/Synchronization-Algorithm-Verificator-for-C-0x/m-p/847368#M1737</link>
      <description>&lt;PRE&gt;I want to announce release 1.1 of Relacy Race Detector.&lt;BR /&gt;&lt;BR /&gt;First of all, now you can freely DOWNLOAD latest version of Relacy&lt;BR /&gt;Race Detector DIRECTLY FROM WEB:&lt;BR /&gt;&lt;A class="moz-txt-link-freetext" href="http://groups.google.com/group/relacy/files"&gt;http://groups.google.com/group/relacy/files&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Main change in release 1.1 is support for standard synchronization&lt;BR /&gt;primitives:&lt;BR /&gt;1. mutex (std::mutex, pthread_mutex_init, InitializeCriticalSection)&lt;BR /&gt;2. rw_mutex (pthread_rwlock_init, InitializeSRWLock)&lt;BR /&gt;3. condition variable (std::condition_variable,&lt;BR /&gt;std::condition_variable_any, pthread_cond_init,&lt;BR /&gt;InitializeConditionVariable)&lt;BR /&gt;4. semaphore (sem_init, CreateSemaphore)&lt;BR /&gt;5. event (CreateEvent)&lt;BR /&gt;&lt;BR /&gt;Now you can test more traditional "mutex-based" algorithms (i.e. no&lt;BR /&gt;lock-free), and Relacy still will detect data races, deadlocks,&lt;BR /&gt;livelocks, resource leaks, incorrect usage of API etc.&lt;BR /&gt;Also you can test mixed lock-based/lock-free algorithms. For example&lt;BR /&gt;fast-path is lock-free, and slow-path is mutex-based.&lt;BR /&gt;For examples see 'spsc_queue' example in distributive, it uses&lt;BR /&gt;std::mutex and std::condition_variable as well as lock-free fast-path.&lt;BR /&gt;And following manual implementation of condition_variable via Win&lt;BR /&gt;API's CreateEvent and CreateSemaphore:&lt;BR /&gt;&lt;A class="moz-txt-link-freetext" href="http://groups.google.com/group/comp.programming.threads/msg/30c2ec41c4d498a2"&gt;http://groups.google.com/group/comp.programming.threads/msg/30c2ec41c4d498a2&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Also I add RL_DEBUGBREAK_ON_ASSERT and RL_MSVC_OUTPUT options. And&lt;BR /&gt;initial_state/final_state parameters. See details here:&lt;BR /&gt;&lt;A class="moz-txt-link-freetext" href="http://groups.google.com/group/relacy/web/advanced-moments"&gt;http://groups.google.com/group/relacy/web/advanced-moments&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Dmitriy V'jukov&lt;/PRE&gt;</description>
      <pubDate>Fri, 15 Aug 2008 18:31:36 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/Synchronization-Algorithm-Verificator-for-C-0x/m-p/847368#M1737</guid>
      <dc:creator>Dmitry_Vyukov</dc:creator>
      <dc:date>2008-08-15T18:31:36Z</dc:date>
    </item>
  </channel>
</rss>

