94 - old multiprocessing experiment
This commit is contained in:
parent
6e56bf32cc
commit
133401ecbc
|
@ -0,0 +1,12 @@
|
|||
(main
|
||||
(fork (thread2 fn))
|
||||
((1 integer) <- literal 34)
|
||||
(print (1 integer))
|
||||
(jmp (-2 offset))
|
||||
)
|
||||
|
||||
(thread2
|
||||
((2 integer) <- literal 35)
|
||||
(print (2 integer))
|
||||
(jmp (-2 offset))
|
||||
)
|
9
mu.arc
9
mu.arc
|
@ -164,7 +164,7 @@
|
|||
(mac caller-arg-idx (context (o idx 0)) ; assignable
|
||||
`((((rep ,context) 'call-stack) ,idx) 'caller-arg-idx))
|
||||
|
||||
(= scheduling-interval* 500)
|
||||
(= scheduling-interval* 5)
|
||||
|
||||
(def parse-instr (instr)
|
||||
(iflet delim (pos '<- instr)
|
||||
|
@ -295,6 +295,13 @@
|
|||
print
|
||||
(do1 nil
|
||||
(apply prn (map m arg)))
|
||||
|
||||
; multiprocessing
|
||||
run
|
||||
(run (v arg.0))
|
||||
fork
|
||||
(enq (make-context (v arg.0)) contexts*)
|
||||
|
||||
reply
|
||||
(do (pop-stack context)
|
||||
(if empty.context (return ninstrs))
|
||||
|
|
Loading…
Reference in New Issue