forked from JavaTX/JavaCompilerCore
removed threadcounter from TypeUnifyTask
This commit is contained in:
parent
d71e67cfdd
commit
e91a9370df
@ -72,11 +72,9 @@ public class TypeUnifyTask extends RecursiveTask<Set<Set<UnifyPair>>> {
|
|||||||
* Fuer die Threads
|
* Fuer die Threads
|
||||||
*/
|
*/
|
||||||
protected UnifyResultModelParallel urm;
|
protected UnifyResultModelParallel urm;
|
||||||
protected static int noOfThread = 0;
|
|
||||||
private static int totalnoOfThread = 0;
|
private static int totalnoOfThread = 0;
|
||||||
int thNo;
|
int thNo;
|
||||||
protected boolean one = false;
|
protected boolean one = false;
|
||||||
Integer MaxNoOfThreads = 128;
|
|
||||||
|
|
||||||
public static final String rootDirectory = System.getProperty("user.dir")+"/test/logFiles/";
|
public static final String rootDirectory = System.getProperty("user.dir")+"/test/logFiles/";
|
||||||
protected WriterActiveObject logFile;
|
protected WriterActiveObject logFile;
|
||||||
@ -171,7 +169,6 @@ public class TypeUnifyTask extends RecursiveTask<Set<Set<UnifyPair>>> {
|
|||||||
this.log = log;
|
this.log = log;
|
||||||
this.pool = pool;
|
this.pool = pool;
|
||||||
|
|
||||||
noOfThread++;
|
|
||||||
totalnoOfThread++;
|
totalnoOfThread++;
|
||||||
//writeLog("thNo1 " + thNo);
|
//writeLog("thNo1 " + thNo);
|
||||||
thNo = totalnoOfThread;
|
thNo = totalnoOfThread;
|
||||||
@ -252,7 +249,6 @@ public class TypeUnifyTask extends RecursiveTask<Set<Set<UnifyPair>>> {
|
|||||||
.filter(x -> x.size()>1)
|
.filter(x -> x.size()>1)
|
||||||
.collect(Collectors.toCollection(ArrayList::new));
|
.collect(Collectors.toCollection(ArrayList::new));
|
||||||
Set<Set<UnifyPair>> res = unify(neweq, remainingOderconstraints, fc, parallel, rekTiefeField, new HashSet<>());
|
Set<Set<UnifyPair>> res = unify(neweq, remainingOderconstraints, fc, parallel, rekTiefeField, new HashSet<>());
|
||||||
noOfThread--;
|
|
||||||
|
|
||||||
if(parallel){
|
if(parallel){
|
||||||
logFile.close();
|
logFile.close();
|
||||||
@ -889,7 +885,7 @@ public class TypeUnifyTask extends RecursiveTask<Set<Set<UnifyPair>>> {
|
|||||||
/* Wenn parallel gearbeitet wird, wird je nach Varianz ein neuer Thread
|
/* Wenn parallel gearbeitet wird, wird je nach Varianz ein neuer Thread
|
||||||
* gestartet, der parallel weiterarbeitet.
|
* gestartet, der parallel weiterarbeitet.
|
||||||
*/
|
*/
|
||||||
if(parallel && (variance == 1) && noOfThread <= MaxNoOfThreads) {
|
if(parallel && (variance == 1)) {
|
||||||
Set<TypeUnify2Task> forks = new HashSet<>();
|
Set<TypeUnify2Task> forks = new HashSet<>();
|
||||||
Set<UnifyPair> newEqOrig = new HashSet<>(eq);
|
Set<UnifyPair> newEqOrig = new HashSet<>(eq);
|
||||||
Set<Set<UnifyPair>> newElemsOrig = new HashSet<>(elems);
|
Set<Set<UnifyPair>> newElemsOrig = new HashSet<>(elems);
|
||||||
@ -939,7 +935,6 @@ public class TypeUnifyTask extends RecursiveTask<Set<Set<UnifyPair>>> {
|
|||||||
/* FORK ANFANG */
|
/* FORK ANFANG */
|
||||||
|
|
||||||
writeLog("wait "+ forkOrig.thNo);
|
writeLog("wait "+ forkOrig.thNo);
|
||||||
noOfThread--;
|
|
||||||
res = forkOrig.join();
|
res = forkOrig.join();
|
||||||
|
|
||||||
//noOfThread++;
|
//noOfThread++;
|
||||||
@ -953,7 +948,6 @@ public class TypeUnifyTask extends RecursiveTask<Set<Set<UnifyPair>>> {
|
|||||||
|
|
||||||
forks.forEach(x -> writeLog("wait: " + x.thNo));
|
forks.forEach(x -> writeLog("wait: " + x.thNo));
|
||||||
for(TypeUnify2Task fork : forks) {
|
for(TypeUnify2Task fork : forks) {
|
||||||
noOfThread--;
|
|
||||||
Set<Set<UnifyPair>> fork_res = fork.join();
|
Set<Set<UnifyPair>> fork_res = fork.join();
|
||||||
|
|
||||||
//noOfThread++;
|
//noOfThread++;
|
||||||
@ -970,7 +964,7 @@ public class TypeUnifyTask extends RecursiveTask<Set<Set<UnifyPair>>> {
|
|||||||
}
|
}
|
||||||
//noOfThread++;
|
//noOfThread++;
|
||||||
} else {
|
} else {
|
||||||
if(parallel && (variance == -1) && noOfThread <= MaxNoOfThreads) {
|
if(parallel && (variance == -1)) {
|
||||||
Set<TypeUnify2Task> forks = new HashSet<>();
|
Set<TypeUnify2Task> forks = new HashSet<>();
|
||||||
Set<UnifyPair> newEqOrig = new HashSet<>(eq);
|
Set<UnifyPair> newEqOrig = new HashSet<>(eq);
|
||||||
Set<Set<UnifyPair>> newElemsOrig = new HashSet<>(elems);
|
Set<Set<UnifyPair>> newElemsOrig = new HashSet<>(elems);
|
||||||
@ -1018,7 +1012,6 @@ public class TypeUnifyTask extends RecursiveTask<Set<Set<UnifyPair>>> {
|
|||||||
|
|
||||||
/* FORK ANFANG */
|
/* FORK ANFANG */
|
||||||
writeLog("wait "+ forkOrig.thNo);
|
writeLog("wait "+ forkOrig.thNo);
|
||||||
noOfThread--;
|
|
||||||
res = forkOrig.join();
|
res = forkOrig.join();
|
||||||
|
|
||||||
//noOfThread++;
|
//noOfThread++;
|
||||||
@ -1032,7 +1025,6 @@ public class TypeUnifyTask extends RecursiveTask<Set<Set<UnifyPair>>> {
|
|||||||
|
|
||||||
forks.forEach(x -> writeLog("wait: " + x.thNo));
|
forks.forEach(x -> writeLog("wait: " + x.thNo));
|
||||||
for(TypeUnify2Task fork : forks) {
|
for(TypeUnify2Task fork : forks) {
|
||||||
noOfThread--;
|
|
||||||
Set<Set<UnifyPair>> fork_res = fork.join();
|
Set<Set<UnifyPair>> fork_res = fork.join();
|
||||||
|
|
||||||
//noOfThread++;
|
//noOfThread++;
|
||||||
@ -1050,7 +1042,7 @@ public class TypeUnifyTask extends RecursiveTask<Set<Set<UnifyPair>>> {
|
|||||||
|
|
||||||
//noOfThread++;
|
//noOfThread++;
|
||||||
} else {
|
} else {
|
||||||
if(parallel && (variance == 2) && noOfThread <= MaxNoOfThreads) {
|
if(parallel && (variance == 2)) {
|
||||||
writeLog("var2einstieg");
|
writeLog("var2einstieg");
|
||||||
Set<TypeUnify2Task> forks = new HashSet<>();
|
Set<TypeUnify2Task> forks = new HashSet<>();
|
||||||
Set<UnifyPair> newEqOrig = new HashSet<>(eq);
|
Set<UnifyPair> newEqOrig = new HashSet<>(eq);
|
||||||
@ -1083,7 +1075,6 @@ public class TypeUnifyTask extends RecursiveTask<Set<Set<UnifyPair>>> {
|
|||||||
/* FORK ANFANG */
|
/* FORK ANFANG */
|
||||||
|
|
||||||
writeLog("wait "+ forkOrig.thNo);
|
writeLog("wait "+ forkOrig.thNo);
|
||||||
noOfThread--;
|
|
||||||
res = forkOrig.join();
|
res = forkOrig.join();
|
||||||
|
|
||||||
//noOfThread++;
|
//noOfThread++;
|
||||||
@ -1097,7 +1088,6 @@ public class TypeUnifyTask extends RecursiveTask<Set<Set<UnifyPair>>> {
|
|||||||
/* FORK ENDE */
|
/* FORK ENDE */
|
||||||
forks.forEach(x -> writeLog("wait: " + x.thNo));
|
forks.forEach(x -> writeLog("wait: " + x.thNo));
|
||||||
for(TypeUnify2Task fork : forks) {
|
for(TypeUnify2Task fork : forks) {
|
||||||
noOfThread--;
|
|
||||||
Set<Set<UnifyPair>> fork_res = fork.join();
|
Set<Set<UnifyPair>> fork_res = fork.join();
|
||||||
|
|
||||||
//noOfThread++;
|
//noOfThread++;
|
||||||
@ -2513,13 +2503,11 @@ public class TypeUnifyTask extends RecursiveTask<Set<Set<UnifyPair>>> {
|
|||||||
if (log && finalresult) {
|
if (log && finalresult) {
|
||||||
if(parallel){
|
if(parallel){
|
||||||
logFile.write("Thread no.:" + thNo + "\n"
|
logFile.write("Thread no.:" + thNo + "\n"
|
||||||
+ "noOfThread:" + noOfThread + "\n"
|
|
||||||
+ "parallel:" + parallel + "\n"
|
+ "parallel:" + parallel + "\n"
|
||||||
+ str+"\n\n"
|
+ str+"\n\n"
|
||||||
);
|
);
|
||||||
}else{
|
}else{
|
||||||
logFile.writeNonThreaded("Thread no.:" + thNo + "\n"
|
logFile.writeNonThreaded("Thread no.:" + thNo + "\n"
|
||||||
+ "noOfThread:" + noOfThread + "\n"
|
|
||||||
+ "parallel:" + parallel + "\n"
|
+ "parallel:" + parallel + "\n"
|
||||||
+ str+"\n\n"
|
+ str+"\n\n"
|
||||||
);
|
);
|
||||||
|
Loading…
Reference in New Issue
Block a user