about summary refs log tree commit diff stats
path: root/apps/ex4
diff options
context:
space:
mode:
authorKartik Agaram <vc@akkartik.com>2020-10-03 22:55:19 -0700
committerKartik Agaram <vc@akkartik.com>2020-10-03 22:55:19 -0700
commit2f5a8496e64c063796ea5daf6381701d7cd873f1 (patch)
tree8b105eba7e7ebdc28503cb1e6f722eae1954ff36 /apps/ex4
parentb6cf4f1db3afe407220613ba76685058b0e2aa09 (diff)
downloadmu-2f5a8496e64c063796ea5daf6381701d7cd873f1.tar.gz
6940
Diffstat (limited to 'apps/ex4')
0 files changed, 0 insertions, 0 deletions
Agaram <vc@akkartik.com> 2015-01-11 18:47:53 -0800 534 - this is how we test blocking channels' href='/akkartik/mu/commit/blocking.arc.t?h=hlt&id=e19e7820270a8b1342153bcabc9b23ba6fdfff2c'>e19e7820 ^
14a1649c ^
e19e7820 ^


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
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)