Skip to content

Commit

Permalink
Update bundled ConcurrencyKit to 0.6.0.
Browse files Browse the repository at this point in the history
  • Loading branch information
akopytov committed Feb 28, 2017
1 parent db1da5b commit 351ccc8
Show file tree
Hide file tree
Showing 8 changed files with 73 additions and 5 deletions.
2 changes: 1 addition & 1 deletion third_party/concurrency_kit/ck/configure
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ WANT_PIC=yes

P_PWD=`pwd`
MAINTAINER='[email protected]'
VERSION=${VERSION:-'0.5.2'}
VERSION=${VERSION:-'0.6.0'}
VERSION_MAJOR='0'
BUILD="$PWD/build/ck.build"
PREFIX=${PREFIX:-"/usr/local"}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,12 @@ read_thread(void *unused CK_CC_UNUSED)
}

while ((ck_pr_load_uint(&epoch.epoch) & 1) ==
section[0].bucket)
section[0].bucket) {
if (ck_pr_load_uint(&leave) == 1)
break;

ck_pr_stall();
}
}

ck_epoch_begin(record, &section[1]);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.PHONY: clean

all: ck_pr_cas_64 ck_pr_fas_64 ck_pr_cas_64_2 fp
all: ck_pr_cas_64 ck_pr_fas_64 ck_pr_cas_64_2 ck_pr_add_64 ck_pr_faa_64 ck_pr_neg_64 fp

fp: fp.c
$(CC) $(CFLAGS) -o fp fp.c
Expand All @@ -14,8 +14,18 @@ ck_pr_cas_64: ck_pr_cas_64.c
ck_pr_fas_64: ck_pr_fas_64.c
$(CC) $(CFLAGS) -o ck_pr_fas_64 ck_pr_fas_64.c -lm

ck_pr_add_64: ck_pr_add_64.c
$(CC) $(CFLAGS) -o ck_pr_add_64 ck_pr_add_64.c -lm

ck_pr_faa_64: ck_pr_faa_64.c
$(CC) $(CFLAGS) -o ck_pr_faa_64 ck_pr_faa_64.c -lm

ck_pr_neg_64: ck_pr_neg_64.c
$(CC) $(CFLAGS) -o ck_pr_neg_64 ck_pr_neg_64.c -lm

clean:
rm -rf ck_pr_cas_64 ck_pr_fas_64 ck_pr_cas_64_2 *.dSYM *.exe
rm -rf ck_pr_cas_64 ck_pr_fas_64 ck_pr_cas_64_2 ck_pr_add_64 \
ck_pr_faa_64 ck_pr_neg_64 *.dSYM *.exe

include ../../../build/regressions.build
CFLAGS+=$(PTHREAD_CFLAGS) -D_GNU_SOURCE
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#include <ck_pr.h>

#ifdef CK_F_PR_ADD_64
#define ATOMIC ck_pr_add_64(object, 1)
#define ATOMIC_STRING "ck_pr_add_64"
#include "benchmark.h"
#else
#warning Did not find ADD_64 implementation.
#include <stdlib.h>

int
main(void)
{
exit(EXIT_FAILURE);
}
#endif
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#include <ck_pr.h>

#ifdef CK_F_PR_FAA_64
#define ATOMIC ck_pr_faa_64(object, 1)
#define ATOMIC_STRING "ck_pr_faa_64"
#include "benchmark.h"
#else
#warning Did not find FAA_64 implementation.
#include <stdlib.h>

int
main(void)
{
exit(EXIT_FAILURE);
}
#endif
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#include <ck_pr.h>

#ifdef CK_F_PR_NEG_64
#define ATOMIC ck_pr_neg_64(object)
#define ATOMIC_STRING "ck_pr_neg_64"
#include "benchmark.h"
#else
#warning Did not find NEG_64 implementation.
#include <stdlib.h>

int
main(void)
{
exit(EXIT_FAILURE);
}
#endif
5 changes: 5 additions & 0 deletions third_party/concurrency_kit/ck/regressions/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -442,6 +442,11 @@ rdtsc(void)
} while (snapshot != high);

return (((uint64_t)high << 32) | low);
#elif defined(__aarch64__)
uint64_t r;

__asm __volatile__ ("mrs %0, cntvct_el0" : "=r" (r) : : "memory");
return r;
#else
return 0;
#endif
Expand Down
3 changes: 2 additions & 1 deletion third_party/concurrency_kit/ck/src/ck_epoch.c
Original file line number Diff line number Diff line change
Expand Up @@ -309,11 +309,12 @@ ck_epoch_scan(struct ck_epoch *global,
{
ck_stack_entry_t *cursor;

*af = false;
if (cr == NULL) {
cursor = CK_STACK_FIRST(&global->records);
*af = false;
} else {
cursor = &cr->record_next;
*af = true;
}

while (cursor != NULL) {
Expand Down

0 comments on commit 351ccc8

Please sign in to comment.