0
votes

When I use shared memory, I can ask the OS memory which is allowed to execute. Is it possible to write to the memory the executable code in python (from a python process) and then execute it from a Java process?

I have a Java process that receives some data from a remote server, and another process in Python that knows how to process that data. After the Java process receives the data, it needs the processed data back. So Instead of sending the data to the python process and then get it back, I thought maybe the python process can share its processing code and the Java process will just use it. This way there's no need to lock the memory while writing.

Theoretically this is possible but starting a new separate Python process is much simpler and safer.Michael Butscher
@MichaelButscher I edited the question, I hope it's clearer now.Rony Tesler
How is this even theoretically possible? Java will be running in a JVM and its structures will be unintelligible to Python, surely?roganjosh
In any case, this is really misguided. There is nothing to be gained here in efficiency; anything that makes this kind of shared memory work (I'm not convinced it can even get there) will be massive overheadroganjosh
@RonyTesler If you use special libraries which give you access to the synchronization primitives of the OS.Michael Butscher