From: adash Date: Tue, 13 Apr 2010 01:31:41 +0000 (+0000) Subject: changes for running recovery version X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=b9f583e824ae55906a63763def8f55e103db4d9a;p=IRC.git changes for running recovery version --- diff --git a/Robust/src/Benchmarks/Recovery/Spider/recovery/QueryTask.java b/Robust/src/Benchmarks/Recovery/Spider/recovery/QueryTask.java index 8346b6e2..4992deee 100644 --- a/Robust/src/Benchmarks/Recovery/Spider/recovery/QueryTask.java +++ b/Robust/src/Benchmarks/Recovery/Spider/recovery/QueryTask.java @@ -275,9 +275,7 @@ public class QueryTask extends Task { do { numchars = sock.read(buffer); - String curr = (new String(buffer)).subString(0, numchars); - lq.response.append(curr); buffer = new byte[1024]; } while(numchars > 0); diff --git a/Robust/src/Benchmarks/Recovery/Spider/recovery/Spider.java b/Robust/src/Benchmarks/Recovery/Spider/recovery/Spider.java index 0f82b51b..00a2d8f6 100644 --- a/Robust/src/Benchmarks/Recovery/Spider/recovery/Spider.java +++ b/Robust/src/Benchmarks/Recovery/Spider/recovery/Spider.java @@ -5,6 +5,7 @@ Usage : public class Spider { + public Spider() {} public static void main(String[] args) { int NUM_THREADS = 3; int maxDepth = 3; @@ -62,6 +63,10 @@ public class Spider { } Thread.myStart(tmp, mid[i]); } + + while(true) + Thread.sleep(100000); + for (i = 0; i < NUM_THREADS; i++) { atomic { tmp = ts.threads[i]; diff --git a/Robust/src/Benchmarks/Recovery/Spider/recovery/Task.java b/Robust/src/Benchmarks/Recovery/Spider/recovery/Task.java index 219b1f15..1398c1c6 100644 --- a/Robust/src/Benchmarks/Recovery/Spider/recovery/Task.java +++ b/Robust/src/Benchmarks/Recovery/Spider/recovery/Task.java @@ -1,6 +1,7 @@ public class Task { //Current worker thread Worker w; + public Task() {} public void execute(); public void setWorker(Worker w) { this.w = w; diff --git a/Robust/src/Benchmarks/Recovery/Spider/recovery/Worker.java b/Robust/src/Benchmarks/Recovery/Spider/recovery/Worker.java index e7ae0040..98a7c1e4 100644 --- a/Robust/src/Benchmarks/Recovery/Spider/recovery/Worker.java +++ b/Robust/src/Benchmarks/Recovery/Spider/recovery/Worker.java @@ -18,7 +18,8 @@ public class Worker extends Thread { if (!tasks.todo.isEmpty()) { //grab segment from todo list t=workingtask=(Task) tasks.todo.pop(); - t.setWorker(this); + if(t!=null) + t.setWorker(this); } else { //steal work from dead threads Worker[] threads=tasks.threads; @@ -27,7 +28,7 @@ public class Worker extends Thread { Worker w=(Worker)threads[i]; if (w.workingtask!=null) shouldexit=false; - if (w.getStatus()==-1&&w.workingtask!=null) { + if (w.getStatus(i)==-1&&w.workingtask!=null) { //steal work from this thread t=workingtask=w.workingtask; w.workingtask=null; @@ -42,9 +43,15 @@ public class Worker extends Thread { if (t!=null) { t.execution(); continue; - } else if (notdone) - sleep(500000); + } else if (notdone) { + System.out.println("Not done"); + sleep(500000); + } + } + System.out.println("\n\nDone\n\n"); + while(true) { + sleep(100000); } } public static native void printRecoveryStat(); -} \ No newline at end of file +} diff --git a/Robust/src/Benchmarks/Recovery/Spider/recovery/makefile b/Robust/src/Benchmarks/Recovery/Spider/recovery/makefile index 98039679..d9c82574 100644 --- a/Robust/src/Benchmarks/Recovery/Spider/recovery/makefile +++ b/Robust/src/Benchmarks/Recovery/Spider/recovery/makefile @@ -3,12 +3,13 @@ SUBCLASS=Query SRC1=${MAINCLASS}.java SRC2=Global${SUBCLASS}.java SRC3=${SUBCLASS}Task.java -FLAGS=-recoverystats -recovery -transstats -dsmcaching -dsm -dsmtask -debug -nooptimize -mainclass ${MAINCLASS} -DSMFLAGS=-dsm -dsmtask -sandbox -transstats -debug -nooptimize -mainclass ${MAINCLASS} +FLAGS=-recoverystats -recovery -transstats -dsmcaching -dsm -dsmtask -optimize -mainclass ${MAINCLASS} +DSMFLAGS= -dsm -dsmtask -sandbox -transstats -optimize -mainclass ${MAINCLASS} default: -# ../../../../buildscript ${FLAGS} -o ${MAINCLASS} ${SRC2} ${SRC3} ${SRC1} - ../../../../buildscript ${DSMFLAGS} -o ${MAINCLASS}DSM *.java + ../../../../buildscript ${DSMFLAGS} -o ${MAINCLASS}DSM GlobalQuery.java LocalQuery.java QueryTask.java Spider.java Task.java GlobalQueue.java Worker.java TaskSet.java + ../../../../buildscript ${FLAGS} -o ${MAINCLASS} GlobalQuery.java LocalQuery.java QueryTask.java Spider.java Task.java GlobalQueue.java Worker.java TaskSet.java clean: rm -rf tmpbuilddirectory rm *.bin +