Recently a question was posed regarding some Python code attempting to facilitate distributed computing through the use of pickled processes. Apparently, that functionality has historically been possible, but for security reasons the same functionality is disabled. On the second attempted at transmitting a function object through a socket, only the reference was transmitted. Correct me if I am wrong, but I do not believe this issue is related to Python’s late binding. Given the presumption that process and thread objects can not be pickled, is there any way to transmit a callable object? We would like to avoid transmitting compressed source code for each job, as that would probably make the entire attempt pointless. Only the Python core library can be used for portability reasons.
Recently a question was posed regarding some Python code attempting to facilitate distributed computing
Share
You could marshal the bytecode and pickle the other function things:
In another python program:
And any references to globals inside the function would have to be recreated in the script that receives the function.
In Python 3, the function attributes used are
__code__,__name__,__defaults__and__closure__.Please do note that
send_through_a_socketandreceive_from_a_socketdo not actually exist, and you should replace them by actual code that transmits data through sockets.