X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=benchmark%2Fseqlock%2Fseqlock.cc;fp=benchmark%2Fseqlock%2Fseqlock.cc;h=0000000000000000000000000000000000000000;hb=d2ea20dfe024fdf297e6776d56bc9066cb040f38;hp=c744435fc1956b47d046ebd814adbb8962a1eda7;hpb=facdc9fd49c05b968c55c54deb21ba5d3a673f52;p=cdsspec-compiler.git diff --git a/benchmark/seqlock/seqlock.cc b/benchmark/seqlock/seqlock.cc deleted file mode 100644 index c744435..0000000 --- a/benchmark/seqlock/seqlock.cc +++ /dev/null @@ -1,41 +0,0 @@ -#include -#include - -#include "seqlock.h" - -seqlock *lock; - -int *readD1; -int *readD2; -static void read_thrd(void *obj) { - readD1 = new int; - readD2 = new int; - lock->read(readD1, readD2); - cout << "Read: d1 = " << *readD1 << ", d2 = " << *readD2 << endl; -} - -static void write_thrd1(void *obj) { - int d1 = 1, d2 = 0; - lock->write(1, 0); - cout << "Write: d1 = " << d1 << ", d2 = " << d2 << endl; -} - -static void write_thrd2(void *obj) { - int d1 = 1, d2 = 2; - lock->write(1, 2); - cout << "Write: d1 = " << d1 << ", d2 = " << d2 << endl; -} - -int user_main(int argc, char *argv[]) { - lock = new seqlock; - thrd_t t1, t2, t3; - thrd_create(&t1, &read_thrd, NULL); - thrd_create(&t2, &write_thrd1, NULL); - //thrd_create(&t3, &write_thrd2, NULL); - - thrd_join(t1); - thrd_join(t2); - //thrd_join(t3); - - return 0; -}