diff --git a/src/main/java/com/ishland/flowsched/executor/WorkerThread.java b/src/main/java/com/ishland/flowsched/executor/WorkerThread.java index 607f9f4..6981bb3 100644 --- a/src/main/java/com/ishland/flowsched/executor/WorkerThread.java +++ b/src/main/java/com/ishland/flowsched/executor/WorkerThread.java @@ -28,14 +28,14 @@ public void run() { continue; } - // attempt to spin-wait before sleeping - if (!pollTasks()) { - Thread.interrupted(); // clear interrupt flag - for (int i = 0; i < 1000; i ++) { - if (pollTasks()) continue main_loop; - LockSupport.parkNanos("Spin-waiting for tasks", 10_000); // 10us - } - } +// // attempt to spin-wait before sleeping +// if (!pollTasks()) { +// Thread.interrupted(); // clear interrupt flag +// for (int i = 0; i < 1000; i ++) { +// if (pollTasks()) continue main_loop; +// LockSupport.parkNanos("Spin-waiting for tasks", 10_000); // 10us +// } +// } // LockSupport.parkNanos("Waiting for tasks", 1_000_000); // 1ms synchronized (this.executorManager.workerMonitor) { diff --git a/src/main/java/com/ishland/flowsched/scheduler/DaemonizedStatusAdvancingScheduler.java b/src/main/java/com/ishland/flowsched/scheduler/DaemonizedStatusAdvancingScheduler.java index 8837230..25fee77 100644 --- a/src/main/java/com/ishland/flowsched/scheduler/DaemonizedStatusAdvancingScheduler.java +++ b/src/main/java/com/ishland/flowsched/scheduler/DaemonizedStatusAdvancingScheduler.java @@ -47,14 +47,14 @@ private void mainLoop() { return; } - // attempt to spin-wait before sleeping - if (!pollTasks()) { - Thread.interrupted(); // clear interrupt flag - for (int i = 0; i < 5000; i ++) { - if (pollTasks()) continue main_loop; - LockSupport.parkNanos("Spin-waiting for tasks", 10_000); // 100us - } - } +// // attempt to spin-wait before sleeping +// if (!pollTasks()) { +// Thread.interrupted(); // clear interrupt flag +// for (int i = 0; i < 5000; i ++) { +// if (pollTasks()) continue main_loop; +// LockSupport.parkNanos("Spin-waiting for tasks", 10_000); // 100us +// } +// } // LockSupport.parkNanos("Waiting for tasks", 1_000_000); // 1ms synchronized (this.notifyMonitor) {