Cilkscreen and __sync_add_and_fetch

Cilkscreen and __sync_add_and_fetch

Bild des Benutzers zardosht.kasheff

The following simple program causes cilkscreen to report an error.

#include
#include
#include

volatile int x;
void race(int b)
{
__sync_add_and_fetch(&x, b);
}

void race1(int b)
{
__sync_add_and_fetch(&x, b);
}

void test(void)
{
cilk_spawn race(1);
cilk_spawn race1(2);
}

int main(int argc, char *argv[])
{
x = 0;
test();

printf("done: x = %d\\n", x);
return 0;
}

3 Beiträge / 0 neu
Letzter Beitrag
Nähere Informationen zur Compiler-Optimierung finden Sie in unserem Optimierungshinweis.
Bild des Benutzers Brandon Hewitt (Intel)

Hello Zardosht!

I can reproduce this problem with Cilkscreen and I've submitteda problem report on this. I'll update the thread when we have a resolution. What kind of urgency do you have here for this problem?

Brandon Hewitt Technical Consulting Engineer Tools Knowledge Base: "http://software.intel.com/en-us/articles/tools" Software Product Support info: "http://www.intel.com/software/support"
Bild des Benutzers zardosht.kasheff

Hello Brandon,

At the moment, we are using the _InterlockedXXX functions as a replacement, so this is not terribly urgent.

-Zardosht

Melden Sie sich an, um einen Kommentar zu hinterlassen.