Cilkscreen and __sync_add_and_fetch

Cilkscreen and __sync_add_and_fetch

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;
}

publicaciones de 3 / 0 nuevos
Último envío
Para obtener más información sobre las optimizaciones del compilador, consulte el aviso sobre la optimización.

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 For 1:1 technical support: http://premier.intel.com Software Product Support info: http://www.intel.com/software/support

Hello Brandon,

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

-Zardosht

Deje un comentario

Por favor inicie sesión para agregar un comentario. ¿No es socio? Únase ya