--- /dev/null
+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;
+ }
+ }
+}
--- /dev/null
+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