diff --git a/src/main/java/teetime/variant/methodcallWithPorts/framework/core/Pipeline.java b/src/main/java/teetime/variant/methodcallWithPorts/framework/core/Pipeline.java index 596dce3fa42cd1032c1a8fee5a1a0374d483cef2..25667aebb153a7d1f5dbdbc50bf9979fd0f87599 100644 --- a/src/main/java/teetime/variant/methodcallWithPorts/framework/core/Pipeline.java +++ b/src/main/java/teetime/variant/methodcallWithPorts/framework/core/Pipeline.java @@ -31,6 +31,8 @@ public class Pipeline<I, O> implements StageWithPort<I, O> { private boolean reschedulable; private int firstStageIndex; + // private final Set<StageWithPort<?, ?>> currentHeads = new HashSet<StageWithPort<?, ?>>(); + public Pipeline() { this.id = UUID.randomUUID().toString(); // the id should only be represented by a UUID, not additionally by the class name this.logger = LogFactory.getLog(this.id); @@ -80,16 +82,23 @@ public class Pipeline<I, O> implements StageWithPort<I, O> { @Override public void executeWithPorts() { this.logger.debug("Executing stage..."); - StageWithPort<?, ?> firstStage = this.stages[this.firstStageIndex]; - firstStage.executeWithPorts(); - this.updateRescheduable(firstStage); - // this.setReschedulable(stage.isReschedulable()); + // StageWithPort<?, ?> headStage = this.currentHeads.next(); + StageWithPort<?, ?> headStage = this.stages[this.firstStageIndex]; + + do { + headStage.executeWithPorts(); + } while (headStage.isReschedulable()); + + this.updateRescheduable(headStage); } private final void updateRescheduable(final StageWithPort<?, ?> stage) { StageWithPort<?, ?> currentStage = stage; while (!currentStage.isReschedulable()) { + // this.currentHeads.remove(currentStage); + // this.currentHeads.addAll(currentStage.getOutputPorts()); + this.firstStageIndex++; // currentStage = currentStage.getOutputPort().getPipe().getTargetStage(); // FIXME what to do with a stage with more than one output port? // if (currentStage == null) { // loop reaches the last stage @@ -100,7 +109,6 @@ public class Pipeline<I, O> implements StageWithPort<I, O> { } currentStage = this.stages[this.firstStageIndex]; currentStage.onIsPipelineHead(); - // System.out.println("firstStageIndex: " + this.firstStageIndex + ", class:" + stage.getClass().getSimpleName()); } this.setReschedulable(true); } diff --git a/src/test/java/teetime/variant/methodcallWithPorts/examples/experiment15/MethodCallThroughputAnalysis15.java b/src/test/java/teetime/variant/methodcallWithPorts/examples/experiment15/MethodCallThroughputAnalysis15.java index 134d80aeb98e967a1d917e154272708aa508da25..0601e70c09f8c8731e005b2b1a417150af368f52 100644 --- a/src/test/java/teetime/variant/methodcallWithPorts/examples/experiment15/MethodCallThroughputAnalysis15.java +++ b/src/test/java/teetime/variant/methodcallWithPorts/examples/experiment15/MethodCallThroughputAnalysis15.java @@ -40,6 +40,7 @@ import teetime.variant.methodcallWithPorts.stage.StopTimestampFilter; * @since 1.10 */ public class MethodCallThroughputAnalysis15 extends Analysis { + // FIXME this analysis sometimes runs infinitely private static final int SPSC_INITIAL_CAPACITY = 4; diff --git a/src/test/java/what tests work.txt b/src/test/java/what tests work.txt deleted file mode 100644 index 5a29be3e567de16bff8f4393c45d854f112c073c..0000000000000000000000000000000000000000 --- a/src/test/java/what tests work.txt +++ /dev/null @@ -1,17 +0,0 @@ -ok -no -inf -inf -inf -no -no -no - - -ok -no - - - - -