From: bdemsky Date: Mon, 5 May 2008 04:45:20 +0000 (+0000) Subject: add linked list traversal benchmark X-Git-Tag: preEdgeChange~105 X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=598dd3458b989f31e9c705f6705129400f6fc62e;p=IRC.git add linked list traversal benchmark --- diff --git a/Robust/src/Benchmarks/Prefetch/Chase/Chase.java b/Robust/src/Benchmarks/Prefetch/Chase/Chase.java new file mode 100644 index 00000000..d402eab8 --- /dev/null +++ b/Robust/src/Benchmarks/Prefetch/Chase/Chase.java @@ -0,0 +1,38 @@ +public class Foo { + public Foo() { + next=null; + } + Foo next; +} + +public class Chase extends Thread { + Foo base; + public Chase(Foo b) { + base=b; + } + + public static void main(String [] argv) { + Chase c; + atomic { + Foo fold=global new Foo(); + + for(int i=0;i<10000;i++) { + Foo f=global new Foo(); + f.next=fold; + fold=f; + } + + c=global new Chase(fold); + } + c.start((128<<24)|(195<<16)|(175<<8)|71); + c.join(); + } + + public void run() { + atomic { + Foo b=base; + while(b!=null) + b=b.next; + } + } +} diff --git a/Robust/src/Benchmarks/Prefetch/Chase/makefile b/Robust/src/Benchmarks/Prefetch/Chase/makefile new file mode 100644 index 00000000..96dc9711 --- /dev/null +++ b/Robust/src/Benchmarks/Prefetch/Chase/makefile @@ -0,0 +1,11 @@ +MAINCLASS=Chase +SRC1=${MAINCLASS}.java +FLAGS=-dsm -prefetch -optimize -debug -excprefetch Chase.main -excprefetch Chase.Chase -mainclass ${MAINCLASS} -trueprob 0.7 +FLAGS2=-dsm -optimize -debug -mainclass ${MAINCLASS} -trueprob 0.7 +default: + ../../../buildscript ${FLAGS2} -o ${MAINCLASS}NP ${SRC1} + ../../../buildscript ${FLAGS} -o ${MAINCLASS}P ${SRC1} + +clean: + rm *.bin + rm -rf tmpbuilddirectory