|
|
@ -106,7 +106,7 @@ test_spmc(void *c)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
ck_error("[%d] Observed %u\n", tid, observed);
|
|
|
|
fprintf(stderr, "[%d] Observed %u\n", tid, observed);
|
|
|
|
return NULL;
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -212,7 +212,7 @@ main(int argc, char *argv[])
|
|
|
|
thread = malloc(sizeof(pthread_t) * nthr);
|
|
|
|
thread = malloc(sizeof(pthread_t) * nthr);
|
|
|
|
assert(thread);
|
|
|
|
assert(thread);
|
|
|
|
|
|
|
|
|
|
|
|
ck_error("SPSC test:");
|
|
|
|
fprintf(stderr, "SPSC test:");
|
|
|
|
for (i = 0; i < nthr; i++) {
|
|
|
|
for (i = 0; i < nthr; i++) {
|
|
|
|
context[i].tid = i;
|
|
|
|
context[i].tid = i;
|
|
|
|
if (i == 0) {
|
|
|
|
if (i == 0) {
|
|
|
@ -236,9 +236,9 @@ main(int argc, char *argv[])
|
|
|
|
|
|
|
|
|
|
|
|
for (i = 0; i < nthr; i++)
|
|
|
|
for (i = 0; i < nthr; i++)
|
|
|
|
pthread_join(thread[i], NULL);
|
|
|
|
pthread_join(thread[i], NULL);
|
|
|
|
ck_error(" done\n");
|
|
|
|
fprintf(stderr, " done\n");
|
|
|
|
|
|
|
|
|
|
|
|
ck_error("SPMC test:\n");
|
|
|
|
fprintf(stderr, "SPMC test:\n");
|
|
|
|
buffer = malloc(sizeof(void *) * (size + 1));
|
|
|
|
buffer = malloc(sizeof(void *) * (size + 1));
|
|
|
|
assert(buffer);
|
|
|
|
assert(buffer);
|
|
|
|
memset(buffer, 0, sizeof(void *) * (size + 1));
|
|
|
|
memset(buffer, 0, sizeof(void *) * (size + 1));
|
|
|
|