*/
struct lcore_plock_test {
struct plock_test *pt[2]; /* shared, lock-protected data */
*/
struct lcore_plock_test {
struct plock_test *pt[2]; /* shared, lock-protected data */
- uint32_t sum[2]; /* local copy of the shared data */
- uint32_t iter; /* number of iterations to perfom */
+ uint64_t sum[2]; /* local copy of the shared data */
+ uint64_t iter; /* number of iterations to perfom */
__func__, lc, i, tm, (long double)tm / i,
lpt->sum[0], lpt->sum[1]);
return 0;
__func__, lc, i, tm, (long double)tm / i,
lpt->sum[0], lpt->sum[1]);
return 0;
lpt = calloc(n, sizeof(*lpt));
sum = calloc(n + 1, sizeof(*sum));
lpt = calloc(n, sizeof(*lpt));
sum = calloc(n + 1, sizeof(*sum));
__func__, iter, utype, n);
__func__, iter, utype, n);
- printf("%s: sum[%u]=%u, pt[%u].val=%u, pt[%u].iter=%u;\n",
+ printf("%s: sum[%u]=%" PRIu64 ", pt[%u].val=%" PRIu64 ", pt[%u].iter=%" PRIu64 ";\n",
__func__, i, sum[i], i, pt[i].val, i, pt[i].iter);
/* race condition occurred, lock doesn't work properly */
if (sum[i] != pt[i].val || 2 * iter != pt[i].iter) {
__func__, i, sum[i], i, pt[i].val, i, pt[i].iter);
/* race condition occurred, lock doesn't work properly */
if (sum[i] != pt[i].val || 2 * iter != pt[i].iter) {