- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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;
}
#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;
}
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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?
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?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello Brandon,
At the moment, we are using the _InterlockedXXX functions as a replacement, so this is not terribly urgent.
-Zardosht
At the moment, we are using the _InterlockedXXX functions as a replacement, so this is not terribly urgent.
-Zardosht

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page