diff --git a/.settings/edu.umd.cs.findbugs.core.prefs b/.settings/edu.umd.cs.findbugs.core.prefs index cd68b2738f2159d6e9169e679fd8297e8bbece62..9df0c3ff22aeb08d71db3835bd78c10dd79f2dc5 100644 --- a/.settings/edu.umd.cs.findbugs.core.prefs +++ b/.settings/edu.umd.cs.findbugs.core.prefs @@ -1,5 +1,5 @@ #FindBugs User Preferences -#Tue Dec 16 14:21:23 CET 2014 +#Tue Dec 16 13:48:45 CET 2014 detector_threshold=3 effort=max excludefilter0=.fbExcludeFilterFile|true diff --git a/src/main/java/teetime/framework/AbstractInterThreadPipe.java b/src/main/java/teetime/framework/AbstractInterThreadPipe.java index 872f965ea66e3c371b4fbde9da8571bc083400a4..980210899354588747cd2339406db559a0be709b 100644 --- a/src/main/java/teetime/framework/AbstractInterThreadPipe.java +++ b/src/main/java/teetime/framework/AbstractInterThreadPipe.java @@ -7,7 +7,6 @@ import org.jctools.queues.spec.ConcurrentQueueSpec; import org.jctools.queues.spec.Ordering; import org.jctools.queues.spec.Preference; -import teetime.framework.pipe.AbstractPipe; import teetime.framework.signal.ISignal; public abstract class AbstractInterThreadPipe extends AbstractPipe { diff --git a/src/main/java/teetime/framework/AbstractIntraThreadPipe.java b/src/main/java/teetime/framework/AbstractIntraThreadPipe.java index 9d0223009c18ca560f29d1589160d90a81e1012f..416a0d6da7edfa9f369fd01df5ca2a1b4624cc6f 100644 --- a/src/main/java/teetime/framework/AbstractIntraThreadPipe.java +++ b/src/main/java/teetime/framework/AbstractIntraThreadPipe.java @@ -1,6 +1,5 @@ package teetime.framework; -import teetime.framework.pipe.AbstractPipe; import teetime.framework.signal.ISignal; public abstract class AbstractIntraThreadPipe extends AbstractPipe { diff --git a/src/main/java/teetime/framework/pipe/AbstractPipe.java b/src/main/java/teetime/framework/AbstractPipe.java similarity index 89% rename from src/main/java/teetime/framework/pipe/AbstractPipe.java rename to src/main/java/teetime/framework/AbstractPipe.java index 1790a4451479385452b89422bf43d75a5dfd9429..b08f101fa980d833722a2deb5a702b6391042cc1 100644 --- a/src/main/java/teetime/framework/pipe/AbstractPipe.java +++ b/src/main/java/teetime/framework/AbstractPipe.java @@ -1,8 +1,6 @@ -package teetime.framework.pipe; +package teetime.framework; -import teetime.framework.Stage; -import teetime.framework.InputPort; -import teetime.framework.OutputPort; +import teetime.framework.pipe.IPipe; public abstract class AbstractPipe implements IPipe { diff --git a/src/main/java/teetime/framework/Analysis.java b/src/main/java/teetime/framework/Analysis.java index fc3b26ae8a331ed3aebbce382dd2cac6a104dc6b..e83d9a31e27048589be691f1bb86ee630ae2928a 100644 --- a/src/main/java/teetime/framework/Analysis.java +++ b/src/main/java/teetime/framework/Analysis.java @@ -50,24 +50,13 @@ public class Analysis implements UncaughtExceptionHandler { /** * - * @return a map of thread/throwable pair + * @return a collection of thread/throwable pairs */ public Collection<Pair<Thread, Throwable>> start() { // start analysis - for (Thread thread : this.consumerThreads) { - thread.setUncaughtExceptionHandler(this); - thread.start(); - } - - for (Thread thread : this.finiteProducerThreads) { - thread.setUncaughtExceptionHandler(this); - thread.start(); - } - - for (Thread thread : this.infiniteProducerThreads) { - thread.setUncaughtExceptionHandler(this); - thread.start(); - } + startThreads(this.consumerThreads); + startThreads(this.finiteProducerThreads); + startThreads(this.infiniteProducerThreads); // wait for the analysis to complete try { @@ -97,12 +86,19 @@ public class Analysis implements UncaughtExceptionHandler { return this.exceptions; } + private void startThreads(final Iterable<Thread> threads) { + for (Thread thread : threads) { + thread.setUncaughtExceptionHandler(this); + thread.start(); + } + } + public AnalysisConfiguration getConfiguration() { return this.configuration; } @Override - public void uncaughtException(final Thread t, final Throwable e) { - this.exceptions.add(Pair.of(t, e)); + public void uncaughtException(final Thread thread, final Throwable throwable) { + this.exceptions.add(Pair.of(thread, throwable)); } } diff --git a/src/main/java/teetime/framework/InputPort.java b/src/main/java/teetime/framework/InputPort.java index 62b14d9bf8452ad4ae7defc8bbfda1ba10abdf75..605eb57c97fcadc8d41d6fa501aa32f1e282af9a 100644 --- a/src/main/java/teetime/framework/InputPort.java +++ b/src/main/java/teetime/framework/InputPort.java @@ -1,8 +1,6 @@ package teetime.framework; -import teetime.framework.pipe.IPipe; - -public class InputPort<T> extends AbstractPort<T> { +public final class InputPort<T> extends AbstractPort<T> { private final Stage owningStage; @@ -11,26 +9,13 @@ public class InputPort<T> extends AbstractPort<T> { this.owningStage = owningStage; } - public T receive() { - @SuppressWarnings("unchecked") - final T element = (T) this.pipe.removeLast(); - return element; - } - - public T read() { - @SuppressWarnings("unchecked") - final T element = (T) this.pipe.readLast(); - return element; - } - /** - * Connects this input port with the given <code>pipe</code> bi-directionally * - * @param pipe + * @return the next element from the connected pipe */ - @Override - public void setPipe(final IPipe pipe) { - this.pipe = pipe; + @SuppressWarnings("unchecked") + public T receive() { + return (T) this.pipe.removeLast(); } public Stage getOwningStage() { diff --git a/src/main/java/teetime/framework/TerminateException.java b/src/main/java/teetime/framework/TerminateException.java new file mode 100644 index 0000000000000000000000000000000000000000..a82b31073fa80b59cc6cc1e7f4962b5f3103990e --- /dev/null +++ b/src/main/java/teetime/framework/TerminateException.java @@ -0,0 +1,12 @@ +package teetime.framework; + +public final class TerminateException extends RuntimeException { + + private static final long serialVersionUID = 6841651916837487909L; + + @Override + public synchronized Throwable fillInStackTrace() { + return this; + } + +} diff --git a/src/performancetest/java/teetime/examples/ChwHomeComparisonMethodcallWithPorts.java b/src/performancetest/java/teetime/examples/ChwHomeComparisonMethodcallWithPorts.java index 3c078b84b06f8e6029c10c18500b803f47d97fae..5f13c9b9d442310cdfeb3447a7403da6a95ad3e5 100644 --- a/src/performancetest/java/teetime/examples/ChwHomeComparisonMethodcallWithPorts.java +++ b/src/performancetest/java/teetime/examples/ChwHomeComparisonMethodcallWithPorts.java @@ -5,9 +5,9 @@ import static org.junit.Assert.assertEquals; import java.util.Map; import java.util.Map.Entry; +import util.test.AbstractProfiledPerformanceAssertion; import util.test.PerformanceResult; import util.test.PerformanceTest; -import util.test.AbstractProfiledPerformanceAssertion; public class ChwHomeComparisonMethodcallWithPorts extends AbstractProfiledPerformanceAssertion { @@ -69,8 +69,12 @@ public class ChwHomeComparisonMethodcallWithPorts extends AbstractProfiledPerfor // assertEquals(75, value17, 4.1); // +22 // since 04.11.2014 (incl.) + // assertEquals(40, value15, 4.1); // -28 + // assertEquals(78, value17, 4.1); // +3 + + // since 13.12.2014 (incl.) assertEquals(40, value15, 4.1); // -28 - assertEquals(78, value17, 4.1); // +3 + assertEquals(43, value17, 4.1); // -35 // below results vary too much, possibly due to the OS' scheduler // assertEquals(RESULT_TESTS_16, (double) test16a.quantiles.get(0.5) / test1.quantiles.get(0.5), 5.1); diff --git a/src/performancetest/java/teetime/examples/experiment10/ChwHomePerformanceCheck.java b/src/performancetest/java/teetime/examples/experiment10/ChwHomePerformanceCheck.java index 8bda58f2804773cf7b363c8629aa1eb8eac4607c..a2bb94e35b648032e06d3534edde8a311ccfc9eb 100644 --- a/src/performancetest/java/teetime/examples/experiment10/ChwHomePerformanceCheck.java +++ b/src/performancetest/java/teetime/examples/experiment10/ChwHomePerformanceCheck.java @@ -24,6 +24,8 @@ class ChwHomePerformanceCheck extends AbstractPerformanceCheck { // since 11.08.2014 (incl.) // assertEquals(47, value10, 2.1); // +21 // since 31.08.2014 (incl.) - assertEquals(51, medianSpeedup, 3.2); + // assertEquals(51, medianSpeedup, 3.2); // +4 + // since 13.12.2014 (incl.) + assertEquals(40, medianSpeedup, 3.2); // -11 } } diff --git a/src/performancetest/java/teetime/examples/experiment14/ChwHomePerformanceCheck.java b/src/performancetest/java/teetime/examples/experiment14/ChwHomePerformanceCheck.java index 17cf68702214d3750685c595387703aef6bf2dc1..bab145f6ebce1b8742a2530aad145b0b12a542b7 100644 --- a/src/performancetest/java/teetime/examples/experiment14/ChwHomePerformanceCheck.java +++ b/src/performancetest/java/teetime/examples/experiment14/ChwHomePerformanceCheck.java @@ -30,6 +30,8 @@ class ChwHomePerformanceCheck extends AbstractPerformanceCheck { // since 04.11.2014 (incl.) // assertEquals(84, medianSpeedup, 2.1); // +22 // since 05.12.2014 (incl.) - assertEquals(75, medianSpeedup, 2.1); // -9 + // assertEquals(75, medianSpeedup, 2.1); // -9 + // since 13.12.2014 (incl.) + assertEquals(44, medianSpeedup, 2.1); // -31 } } diff --git a/target/site/images/code_screenshot.jpg b/target/site/images/code_screenshot.jpg deleted file mode 100644 index 22faa31f8dd4b3d533321c83e8ac72a5a2a57b5a..0000000000000000000000000000000000000000 Binary files a/target/site/images/code_screenshot.jpg and /dev/null differ