30 lines
586 B
Forth
30 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
|
||
|
~~~
|