barnacle wrote:
That sounds vaguely like the original windows 16 message handler, Gordon, except for the ability to force a switch if a task decided to hog the processor.
Neil
Neil
It's actually modelled on the Inmos Transputer - which did that in the hardware/microcode. The transputer would run a thread for about 100mS then switch to the next thread at the next jump instruction. Nothing was saved except the stack pointer. A linked list was used to track the threads. Compilers had to "know" that registers would be potentially trashed after a jump, but that was ok as there were only 3 of them which worked like a push/pull stack.
As my system is a bytecode VM, I also chose to use the jump instruction(s) as the task switch point, although in my case, I do save the 3 registers plus 3 others that the virtual cpu uses, but still keep a linked list of tasks. (I call them Imps) In theory a program with no jumps would run forever but that's never going to happen.
I'm also looking at making it more like Tony Hoares Communicating sequential processes model. Channels are means to pass messages between processes e.g. a filing system and a user program, and so on, but also between individual user processes - each of which could be running on a different core. That extends to hardware channels or "links" to use Transputer terminology. The idea being it could be run in a multi cpu or multi-core environment. Not quite there yet as this was a bit of an after thought, but it all fits into the same model.
I have experimented with using a VIA to connect 2 x 65xx systems together (and 65xx to AVR) - hardware works, it's just software. My current development board has a 2-core RISC-V setup so when I have time I'll start to look at bringing up the 2nd core.
If anyone were to do a 2-core '816 system, then it may be adapted but that's never going to happen, but I do have a backplane ready to go for my '816 system that has the capacity to have multiple CPU boards as well as peripherals. (That's probably never going to happen either)
-Gordon