I had an interesting idea last night: what if you had multiple processors running the same uLisp program? How would they communicate?
This isn’t the same as multi-threading, since all the threads running in the same cpu (regardless of how many cores) can access the same shared uLisp workspace, so a simple mutex is enough to prevent corruption.
If there are physically two separate processors, just hooked into each other so that they can communicate, a garbage collection on one won’t corrupt the other.
My idea is as follows: an extension for uLisp that would allow two processors with the extension installed to both run the same program and the code can communicate between threads via global variables without concerning itself with exactly how the processors communicate.
Whenever a global variable is changed, a message is blasted out to all of the other processors telling them what it was changed to, and this is caught in an interrupt, decoded, and updated locally.
When a thread running on one processor wants to spawn a new thread, it sends out a message querying the others for how many open thread slots and how much free memory they have. The sending processor then chooses one, serializes the code to be run, and sends it to the chosen target processor, and then both continue on with their respective threads.
The implementation would be designed in such a way that you could conceivably hook a Teensy up with a ATmega328 and neither would care.
How does this sound? Implementable? Impossible? I’m hoping this would enable uLisp users to increase their processing power by simply adding more processing power and then employing a divide-and-conquer strategy with data processing.