about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2015-01-24 23:36:30 -0800
committerKartik K. Agaram <vc@akkartik.com>2015-01-24 23:36:30 -0800
commit5bf97dd2d18cbf97c6aa21213f903f9d7708f151 (patch)
treeb67449beaac26e24e1460c83329df8e33738731b
parent995827aca1919be76256bee79cef8f47df070b39 (diff)
downloadmu-5bf97dd2d18cbf97c6aa21213f903f9d7708f151.tar.gz
615 - eliminate scheduler non-determinism
-rw-r--r--mu.arc7
1 files changed, 5 insertions, 2 deletions
diff --git a/mu.arc b/mu.arc
index 7740c355..a4e423ee 100644
--- a/mu.arc
+++ b/mu.arc
@@ -364,14 +364,14 @@
         :else
           (err "illegal scheduler state"))
     (= routine* nil))
-  (each (routine _) canon.sleeping-routines*
+  (each (routine _) routine-canon.sleeping-routines*
     (when (aand rep.routine!limit (<= it (- curr-cycle* rep.routine!running-since)))
       (trace "schedule" "routine timed out")
       (wipe sleeping-routines*.routine)
       (push routine completed-routines*)
 ;?       (tr completed-routines*)
       ))
-  (each (routine _) canon.sleeping-routines*
+  (each (routine _) routine-canon.sleeping-routines*
     (when (ready-to-wake-up routine)
       (trace "schedule" "waking up " label.routine)
       (wipe sleeping-routines*.routine)  ; do this before modifying routine
@@ -1426,6 +1426,9 @@
 (def int-canon (table)
   (sort (compare < car) (as cons table)))
 
+(def routine-canon (routine-table)
+  (sort (compare < label:car) (as cons routine-table)))
+
 (def repr (val)
   (tostring write.val))