about summary refs log tree commit diff stats
path: root/archive/0.vm.arc/blocking.arc.t
diff options
context:
space:
mode:
Diffstat (limited to 'archive/0.vm.arc/blocking.arc.t')
-rw-r--r--archive/0.vm.arc/blocking.arc.t26
1 files changed, 26 insertions, 0 deletions
diff --git a/archive/0.vm.arc/blocking.arc.t b/archive/0.vm.arc/blocking.arc.t
new file mode 100644
index 00000000..80f7f229
--- /dev/null
+++ b/archive/0.vm.arc/blocking.arc.t
@@ -0,0 +1,26 @@
+(selective-load "mu.arc" section-level)
+(set allow-raw-addresses*)
+
+(reset)
+(new-trace "blocking-example")
+(add-code
+  '((function reader [
+      (default-space:space-address <- new space:literal 30:literal/capacity)
+      (x:tagged-value 1:channel-address/space:global <- read 1:channel-address/space:global)
+     ])
+    (function main [
+      (default-space:space-address <- new space:literal 30:literal/capacity)
+      (1:channel-address <- init-channel 3:literal)
+      (2:integer/routine <- fork-helper reader:fn default-space:space-address/globals 50:literal/limit)
+      ; write nothing to the channel
+;?       (sleep until-routine-done:literal 2:integer/routine)
+     ])))
+;? (= dump-trace* (obj whitelist '("schedule" "run")))
+(run 'main)
+;? (prn "completed:")
+;? (each r completed-routines*
+;?   (prn " " r))
+(when (ran-to-completion 'reader)
+  (prn "F - reader waits for input"))
+
+(reset)