On Sunday, January 20, 2019, 7:36:25 PM GMT+2, Pavel Hofman <address@hidden> wrote:
Please does anyone have any experience with passing complete variables
between two independent octave processes (not parent/child via popen)?
The transport channel is easy - sockets, zeromq etc. I assume for
serialization I could use the 'save' function:
bitstream = save('-', 'variable')
But I was not able to find a simple way to deserialize contents of the
'bitstream' variable back to 'variable'. The 'load' function does not
accept input from a variable (as far as I understand the documentation),
only from a real file.
Actually, I would love to use a sequence of plain files but several
messages must be sent every second and SSD drives do not like this
constant create/delete file load. Creating a RAM drive would work but I
need a multiplatform solution (linux, windows) and creating the
platform-specific RAM drive would overcomplicate the project deployment.
Thank you in advance for any suggestions, experience, etc.
Start from named pipes "Introduction to Named Pipes" - Introduction to Named Pipes | Linux Journal
Introduction to Named Pipes | Linux Journal
Using named pipes you can save Octave variables using 'save' in one process and load Octave variables in another process using 'load'. And/or maybe 'fwrite' and 'fread' preceded by 'fopen'.
Named pipes also exist in Windows.