about summary refs log tree commit diff stats
path: root/archive/1.vm/fork.mu
blob: af414cf2040c2a9cb20096e31e4c8e1c0575e4b6 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
# example program: running multiple routines

def main [
  start-running thread2
  {
    $print 34
    loop
  }
]

def thread2 [
  {
    $print 35
    loop
  }
]
na"><- 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)