More Cogs from One Prop
Humanoido
Posts: 5,770
Is it possible to create one or more extra tiny virtual cogs inside a Prop chip?
Humanoido
Humanoido
Comments
Humanoido
Have a look at FullDuplexSerial. Note the cunning way it has two threads of execution going on. One for transmit and one for receive. That technique is generally referred to as coroutines (as opposed to subroutines). One returns to the other which returns to the first and so on.
Perhaps not quite inside a COG but you might think about making and LMM execution loop that has multiple LMM Program Counters and hence executes two or more threads of LMM code sort of at the same time.
So four threads might look like so:
Edit: Not sure it's possible to make a thread example in Spin. Someone here did recently post some ideas and code for implementing threads in COGs. Can't remember who...
Edit: I hate those stupid code boxes with totally unnecessary scroll bars.
John Abshier
Thanks Leon, Heater, John Abshier (and PJV). 8 to 16 threads per Cog, up to 128 for LEDs - This is fantastic! It puts this project in a new perspective. With a 320 Cog machine, tiny processor threads could yield totals ranging from 2,560 processors to 40,960 processors.
[code]320