Compare commits

...

2 Commits

Author SHA1 Message Date
NoName11234
b806fa88ff removed synchronized-block from writeLog() and writeStatistics() in TypeUnifyTask 2024-01-18 21:21:42 +01:00
NoName11234
301e9143ec changed output of unifyTest() 2024-01-18 21:20:48 +01:00
2 changed files with 5 additions and 8 deletions

View File

@@ -2609,7 +2609,6 @@ public class TypeUnifyTask extends RecursiveTask<Set<Set<UnifyPair>>> {
}
void writeLog(String str) {
synchronized ( this ) {
if (log && finalresult) {
try {
logFile.write("Thread no.:" + thNo + "\n");
@@ -2617,18 +2616,15 @@ public class TypeUnifyTask extends RecursiveTask<Set<Set<UnifyPair>>> {
logFile.write("parallel:" + parallel + "\n");
logFile.write(str+"\n\n");
logFile.flush();
}
catch (IOException e) {
catch (IOException e) {
System.err.println("kein LogFile");
}
}
}
}
}
void writeStatistics(String str) {
if (finalresult) {
synchronized ( this ) {
try {
statistics.write("Thread No. " + thNo + ": " + str + "\n");
statistics.flush();
@@ -2637,6 +2633,6 @@ public class TypeUnifyTask extends RecursiveTask<Set<Set<UnifyPair>>> {
catch (IOException e) {
System.err.println("kein StatisticsFile");
}
}}
}
}
}

View File

@@ -88,7 +88,8 @@ public class UnifyTest {
ConstraintSet< Pair> cons = new ConstraintSet<>();
UnifyResultModel urm = new UnifyResultModel(cons, finiteClosure);
UnifyTaskModel tasks = new UnifyTaskModel();
urm = unifyAlgo.unifyParallel(undConstraints, oderConstraints, finiteClosure, new NullWriter(), false, urm, tasks);
Set<Set<UnifyPair>> solution = unifyAlgo.unify(undConstraints, oderConstraints, finiteClosure, new NullWriter(), false, urm, tasks);
System.out.println(solution.size());
}
/*
@Test