retroforth/multicore.retro
crc 5d44897537 add a test file for multicore support
FossilOrigin-Name: 0efb0bfabd2e0ef938d29743773c351e73999ee0e0145d2c8381a3d25e42335d
2021-07-29 11:32:13 +00:00

29 lines
586 B
Forth

Testing for multiple core support.
~~~
:core #8000 io:scan-for io:invoke ;
:core:init (n-) #0 core ;
:core:start (an-) #1 core ;
:core:pause (n-) #2 core ;
:core:pause-current #3 core ;
:core:resume (n-) #4 core ;
:core:rr (n-v) #5 core ;
:core:wr (vn-) #6 core ;
~~~
~~~
'Done var
:a [ @Done #100000 lt? 0; drop &Done v:inc $a c:put ] forever ;
:b [ $b c:put ] forever ;
:c [ $c c:put ] forever ;
:d [ $d c:put ] forever ;
#1 core:init &a #1 core:start
#2 core:init &b #2 core:start
#3 core:init &c #3 core:start
#4 core:init &d #4 core:start
core:pause-current
~~~