X-Git-Url: http://plrg.eecs.uci.edu/git/?p=cdsspec-compiler.git;a=blobdiff_plain;f=benchmark%2Fconcurrent-hashmap%2Fmain.cc;fp=benchmark%2Fconcurrent-hashmap%2Fmain.cc;h=0000000000000000000000000000000000000000;hp=4190075cbd195d946774878be9cc8f2057fd66f6;hb=d2ea20dfe024fdf297e6776d56bc9066cb040f38;hpb=facdc9fd49c05b968c55c54deb21ba5d3a673f52 diff --git a/benchmark/concurrent-hashmap/main.cc b/benchmark/concurrent-hashmap/main.cc deleted file mode 100644 index 4190075..0000000 --- a/benchmark/concurrent-hashmap/main.cc +++ /dev/null @@ -1,34 +0,0 @@ -#include -#include -#include "hashmap.h" - -HashMap *table; - -void threadA(void *arg) { - table->put(1, 1); - printf("Thrd A: Put %d -> %d\n", 1, 1); - int r1 = table->get(2); - printf("Thrd A: Get %d\n", r1); -} - -void threadB(void *arg) { - table->put(2, 2); - printf("Thrd B: Put %d -> %d\n", 2, 2); - int r2 = table->get(1); - printf("Thrd B: Get %d\n", r2); -} - -int user_main(int argc, char *argv[]) { - thrd_t t1, t2; - - table = new HashMap; - - thrd_create(&t1, threadA, NULL); - thrd_create(&t2, threadB, NULL); - thrd_join(t1); - thrd_join(t2); - - return 0; -} - -