<?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 Fake mutex in Software Archive</title>
    <link>https://community.intel.com/t5/Software-Archive/Fake-mutex/m-p/740673#M283</link>
    <description>&lt;P&gt;This is a known problem in cilkscreen.h that is fixed in a future version of the tools. You can fix it your version by modifying the definition of __cilkscreen_metacall in your copy:&lt;/P&gt;&lt;PRE&gt;/*
 * Cilkscreen "functions".  These macros generate metadata in your application
 * to notify Cilkscreen of program state changes
 */

#if ! defined(CILK_STUB) &amp;amp;&amp;amp; defined(__INTEL_COMPILER)
#  define __cilkscreen_metacall(annotation,expr) \
    __notify_intrinsic(&lt;SPAN style="color: blue;"&gt;(char *)&lt;/SPAN&gt;annotation,expr)
#else
#  define __cilkscreen_metacall(annotation,expr) (annotation, (void) (expr))
#endif

&lt;/PRE&gt;&lt;P&gt;- Barry&lt;/P&gt;</description>
    <pubDate>Tue, 27 Dec 2011 16:29:52 GMT</pubDate>
    <dc:creator>Barry_T_Intel</dc:creator>
    <dc:date>2011-12-27T16:29:52Z</dc:date>
    <item>
      <title>Fake mutex</title>
      <link>https://community.intel.com/t5/Software-Archive/Fake-mutex/m-p/740667#M277</link>
      <description>Hi, Does Cilk Plus support fake_mutex? I could not find it in the documentation or language specification. Thanks.</description>
      <pubDate>Wed, 30 Nov 2011 04:54:13 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Fake-mutex/m-p/740667#M277</guid>
      <dc:creator>yodw</dc:creator>
      <dc:date>2011-11-30T04:54:13Z</dc:date>
    </item>
    <item>
      <title>Fake mutex</title>
      <link>https://community.intel.com/t5/Software-Archive/Fake-mutex/m-p/740668#M278</link>
      <description>&lt;P&gt;fake_mutex isn't part of the language. It's a feature of theCilk screen race detector, and shipped with the Cilk Plus SDK which you can download for free from &lt;A href="http://software.intel.com/en-us/articles/intel-cilk-plus-software-development-kit/"&gt;http://software.intel.com/en-us/articles/intel-cilk-plus-software-development-kit/&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;- Barry&lt;/P&gt;</description>
      <pubDate>Wed, 30 Nov 2011 14:07:56 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Fake-mutex/m-p/740668#M278</guid>
      <dc:creator>Barry_T_Intel</dc:creator>
      <dc:date>2011-11-30T14:07:56Z</dc:date>
    </item>
    <item>
      <title>Fake mutex</title>
      <link>https://community.intel.com/t5/Software-Archive/Fake-mutex/m-p/740669#M279</link>
      <description>&lt;P&gt;&lt;/P&gt;Which header file should I import? My include directory does not have cilk/fake_lock.h. I'm usingcomposer_xe_2011_sp1.7.256. Thanks.&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;Yod&lt;/DIV&gt;</description>
      <pubDate>Wed, 30 Nov 2011 14:24:32 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Fake-mutex/m-p/740669#M279</guid>
      <dc:creator>yodw</dc:creator>
      <dc:date>2011-11-30T14:24:32Z</dc:date>
    </item>
    <item>
      <title>Fake mutex</title>
      <link>https://community.intel.com/t5/Software-Archive/Fake-mutex/m-p/740670#M280</link>
      <description>&lt;P&gt;First you need to install the Cilk Plus SDK as I stated in the previous reply. Then you can install cilktools/fake_mutex. Here's one of our test programs as an example: &lt;/P&gt;&lt;PRE&gt;#include &lt;STDLIB.H&gt;
#include &lt;CILK&gt;
#include &lt;CILKTOOLS&gt;
#include &lt;CILKTOOLS&gt;
#include &lt;STDIO.H&gt;

int x;

void race(void)
{
    x = 0;
}

void lock_and_race (cilkscreen::fake_mutex *m)
{
    m-&amp;gt;lock();
    race();
    m-&amp;gt;unlock();
}

void test_bare_fake_lock(void)
{
    printf ("test_bare_fake_lock\n");

    cilkscreen::fake_mutex *m = cilkscreen::create_fake_mutex();
    cilk_spawn lock_and_race(m);
    cilk_spawn lock_and_race(m);
    cilk_spawn lock_and_race(m);
    cilk_spawn lock_and_race(m);
    cilk_sync;
    cilkscreen::destroy_fake_mutex(m);
}

void guard_and_race (cilkscreen::fake_mutex *m)
{
    cilkscreen::lock_guard&lt;:FAKE_MUTEX&gt; guard(*m);

    race();
}

void test_guarded_fake_lock(void)
{
    printf ("test_guarded_fake_lock\n");
    cilkscreen::fake_mutex *m = cilkscreen::create_fake_mutex();
    cilk_spawn guard_and_race(m);
    cilk_spawn guard_and_race(m);
    cilk_spawn guard_and_race(m);
    cilk_spawn guard_and_race(m);
    cilk_sync;
    cilkscreen::destroy_fake_mutex(m);
}

int main (int argc, char *argv[])
{
     test_bare_fake_lock();
     test_guarded_fake_lock();
     printf("done\n");
     return 0;
}

&lt;/:FAKE_MUTEX&gt;&lt;/STDIO.H&gt;&lt;/CILKTOOLS&gt;&lt;/CILKTOOLS&gt;&lt;/CILK&gt;&lt;/STDLIB.H&gt;&lt;/PRE&gt;&lt;P&gt;- Barry&lt;/P&gt;</description>
      <pubDate>Wed, 30 Nov 2011 15:02:29 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Fake-mutex/m-p/740670#M280</guid>
      <dc:creator>Barry_T_Intel</dc:creator>
      <dc:date>2011-11-30T15:02:29Z</dc:date>
    </item>
    <item>
      <title>Fake mutex</title>
      <link>https://community.intel.com/t5/Software-Archive/Fake-mutex/m-p/740671#M281</link>
      <description>It works. Thanks.</description>
      <pubDate>Wed, 30 Nov 2011 16:31:24 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Fake-mutex/m-p/740671#M281</guid>
      <dc:creator>yodw</dc:creator>
      <dc:date>2011-11-30T16:31:24Z</dc:date>
    </item>
    <item>
      <title>Fake mutex</title>
      <link>https://community.intel.com/t5/Software-Archive/Fake-mutex/m-p/740672#M282</link>
      <description>Hello Barry,&lt;BR /&gt;&lt;BR /&gt;When i try to compile this program (named mutex.cpp), i have the following errors :&lt;BR /&gt;&lt;BR /&gt;$ icpc -pthread -o mutex mutex.cpp -lcilkrts&lt;BR /&gt;/home/amina/projet/cilkplus-install/include/cilktools/fake_mutex.h(62): error: argument of type "const char *" is incompatible with parameter of type "void *"&lt;BR /&gt; __cilkscreen_acquire_lock(&amp;amp;lock_val);&lt;BR /&gt; ^&lt;BR /&gt;&lt;BR /&gt;/home/amina/projet/cilkplus-install/include/cilktools/fake_mutex.h(71): error: argument of type "const char *" is incompatible with parameter of type "void *"&lt;BR /&gt; __cilkscreen_release_lock(&amp;amp;lock_val);&lt;BR /&gt; ^&lt;BR /&gt;&lt;BR /&gt;compilation aborted for mutex.cpp (code 2)&lt;BR /&gt;&lt;BR /&gt;I attached the files : fake_mutex.h and cilkscreen.h.&lt;BR /&gt;&lt;BR /&gt;But when i compile it with the command g++, it works fine (g++ -pthread -o mutex mutex.cpp -lcilkrts). (for notes : i use the gcc 4.7.0 version).&lt;BR /&gt;&lt;BR /&gt;Have you a fix for this ?&lt;BR /&gt;&lt;BR /&gt;Thank you,</description>
      <pubDate>Sun, 25 Dec 2011 16:56:45 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Fake-mutex/m-p/740672#M282</guid>
      <dc:creator>amina-jarraya</dc:creator>
      <dc:date>2011-12-25T16:56:45Z</dc:date>
    </item>
    <item>
      <title>Fake mutex</title>
      <link>https://community.intel.com/t5/Software-Archive/Fake-mutex/m-p/740673#M283</link>
      <description>&lt;P&gt;This is a known problem in cilkscreen.h that is fixed in a future version of the tools. You can fix it your version by modifying the definition of __cilkscreen_metacall in your copy:&lt;/P&gt;&lt;PRE&gt;/*
 * Cilkscreen "functions".  These macros generate metadata in your application
 * to notify Cilkscreen of program state changes
 */

#if ! defined(CILK_STUB) &amp;amp;&amp;amp; defined(__INTEL_COMPILER)
#  define __cilkscreen_metacall(annotation,expr) \
    __notify_intrinsic(&lt;SPAN style="color: blue;"&gt;(char *)&lt;/SPAN&gt;annotation,expr)
#else
#  define __cilkscreen_metacall(annotation,expr) (annotation, (void) (expr))
#endif

&lt;/PRE&gt;&lt;P&gt;- Barry&lt;/P&gt;</description>
      <pubDate>Tue, 27 Dec 2011 16:29:52 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Fake-mutex/m-p/740673#M283</guid>
      <dc:creator>Barry_T_Intel</dc:creator>
      <dc:date>2011-12-27T16:29:52Z</dc:date>
    </item>
    <item>
      <title>Fake mutex</title>
      <link>https://community.intel.com/t5/Software-Archive/Fake-mutex/m-p/740674#M284</link>
      <description>Thank you Barry, it works fine :)</description>
      <pubDate>Sat, 31 Dec 2011 13:24:40 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Fake-mutex/m-p/740674#M284</guid>
      <dc:creator>amina-jarraya</dc:creator>
      <dc:date>2011-12-31T13:24:40Z</dc:date>
    </item>
  </channel>
</rss>

