Hi Wim,
That's very interesting, in parallel to this, I've been exchanging
emails with Felix on that same topic. I have had a nasty wasp sting on
my right hand, so I can't type a long reply, but I just wanted to pass
along the code that I've been playing with.
Inspired by the T4(transputer) and its idea of links to other
transputers, my approach was to think of a Link device(#f0) as a way
to hook up to other Uxns, and distribute a task. To give you a taste
of the implementation, here's a uxntal project that has the equivalent
of an occam PAR block, where each #f0 DEO2, requests a uxn to do a
vector evaluation of the address on a free thread, with a copy of the
current stack state. The implementation itself is non-intrusive, and
can be polyfilled by evaluating the address sequentially for systems
that do not want to implement multi-tasking.
|0100
;hello-txt
DUP2
&PAR ( -- )
( task ) ;do-uppercase #f0 DEO2
INC2 LDAk ?&PAR
POP2
( sync ) #0000 #f0 DEO2
print-text
BRK
@do-uppercase ( addr* -> )
STH2k LDA #20 SUB2 STH2r STA
BRK
I'd like to write more when I feel better, your implementation is very
involved and will force programmers to do a lot of legwork, I was
thinking it might be best to handle a few things behind the scene, I'm
not sure yet tho, I'd like to run a few more tests :)
Looking forward to see where you want to take this, if uxn had a way
to do parallel for loops, I can see myself using that A LOT.
Talk soon!
Dll