The goal of this question is to ask if it is possible to have some compiled code (think in terms of an ordinary program, not necessarily written in any special way [e.g multi-threaded] or in any particular paradigm/language) being sent through the network to be somehow processed in a cpu located in another machine.
Ok, so this involves a lot of concepts, and i am not particularly familiar with neither distributed computing nor kernel/OS concepts, so pardon me if this question seems too broad or too unfocused; i will do my best to stay on track.
Let's say we have assembly code (instructions) for a function in our code. It's a simple function that takes x and outputs y by adding 1 to x. I know that at the execution level, the CPU needs to fetch the value of x, move it into a CPU register, perform the addition and then perform a RET instruction at the end.
Would it be possible, conceptually, to pass along through the network the instructions alongside any contextual information needed for execution? If so, what would be the necessary information? The initial state of the CPU registers and instructions, or even more information?
I guess the kernel would be deeply involved in the coordination of such process, but what i am mostly struggling to realize is what would be the minimum 'package' of information i would need to assemble into a message so a computer in the other end of the network would be able to perform the simple calculation OR if this just simply makes no sense given the restrictions of PC architectures.
There is a lot of information about distributed computing out there, but it mostly takes for granted that the code is designed in a specific way. I am interested in a similar solution for any already existant code.