diff --git a/src/main/java/de/dhbwstuttgart/typeinference/unify/TypeUnify2Task.java b/src/main/java/de/dhbwstuttgart/typeinference/unify/TypeUnify2Task.java index b3884e07..54c3fb99 100644 --- a/src/main/java/de/dhbwstuttgart/typeinference/unify/TypeUnify2Task.java +++ b/src/main/java/de/dhbwstuttgart/typeinference/unify/TypeUnify2Task.java @@ -39,8 +39,8 @@ public class TypeUnify2Task extends TypeUnifyTask { return new HashSet<>(); } else */ - - noOfThread--; + //writeLog("xxx"); + //noOfThread--; synchronized (usedTasks) { if (this.myIsCancelled()) { return new HashSet<>(); diff --git a/src/main/java/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java b/src/main/java/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java index 39f55184..8e940d70 100644 --- a/src/main/java/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java +++ b/src/main/java/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java @@ -904,9 +904,10 @@ public class TypeUnifyTask extends RecursiveTask>> { /* FORK ANFANG */ synchronized (this) { - noOfThread--; writeLog("wait "+ forkOrig.thNo); + noOfThread--; res = forkOrig.join(); + //noOfThread++; forkOrig.writeLog("final Orig 1"); forkOrig.closeLogFile(); //Set> fork_res = forkOrig.join(); @@ -919,7 +920,9 @@ public class TypeUnifyTask extends RecursiveTask>> { forks.forEach(x -> writeLog("wait: " + x.thNo)); for(TypeUnify2Task fork : forks) { synchronized (this) { + noOfThread--; Set> fork_res = fork.join(); + //noOfThread++; writeLog("Join " + new Integer(fork.thNo).toString()); //noOfThread--; an das Ende von compute verschoben writeLog("fork_res: " + fork_res.toString()); @@ -932,7 +935,7 @@ public class TypeUnifyTask extends RecursiveTask>> { fork.closeLogFile(); }; } - noOfThread++; + //noOfThread++; } else { if(parallel && (variance == -1) && noOfThread <= MaxNoOfThreads) { Set forks = new HashSet<>(); @@ -1007,9 +1010,10 @@ public class TypeUnifyTask extends RecursiveTask>> { /* FORK ANFANG */ synchronized (this) { - noOfThread--; writeLog("wait "+ forkOrig.thNo); + noOfThread--; res = forkOrig.join(); + //noOfThread++; forkOrig.writeLog("final Orig -1"); forkOrig.closeLogFile(); //Set> fork_res = forkOrig.join(); @@ -1022,7 +1026,9 @@ public class TypeUnifyTask extends RecursiveTask>> { forks.forEach(x -> writeLog("wait: " + x.thNo)); for(TypeUnify2Task fork : forks) { synchronized (this) { + noOfThread--; Set> fork_res = fork.join(); + //noOfThread++; writeLog("Join " + new Integer(fork.thNo).toString()); //noOfThread--; an das Ende von compute verschoben writeLog("fork_res: " + fork_res.toString()); @@ -1035,7 +1041,7 @@ public class TypeUnifyTask extends RecursiveTask>> { fork.closeLogFile(); }; } - noOfThread++; + //noOfThread++; } else { if(parallel && (variance == 2) && noOfThread <= MaxNoOfThreads) { writeLog("var2einstieg"); @@ -1080,9 +1086,10 @@ public class TypeUnifyTask extends RecursiveTask>> { /* FORK ANFANG */ synchronized (this) { - noOfThread--; writeLog("wait "+ forkOrig.thNo); + noOfThread--; res = forkOrig.join(); + //noOfThread++; forkOrig.writeLog("final Orig 2"); forkOrig.closeLogFile(); //Set> fork_res = forkOrig.join(); @@ -1094,7 +1101,9 @@ public class TypeUnifyTask extends RecursiveTask>> { forks.forEach(x -> writeLog("wait: " + x.thNo)); for(TypeUnify2Task fork : forks) { synchronized (this) { + noOfThread--; Set> fork_res = fork.join(); + //noOfThread++; writeLog("Join " + new Integer(fork.thNo).toString()); //noOfThread--; an das Ende von compute verschoben add_res.add(fork_res); @@ -1102,7 +1111,7 @@ public class TypeUnifyTask extends RecursiveTask>> { fork.closeLogFile(); }; } - noOfThread++; + //noOfThread++; } else { //parallel = false; //Wenn MaxNoOfThreads erreicht ist, sequentiell weiterarbeiten elems.add(a); //PL 2019-01-16 muss das wirklich hin steht schon in Zeile 859 ja braucht man siehe Zeile 859