Dne 20. 01. 19 v 18:42 Sergei Steshenko napsal(a):
> 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.
Thanks a lot for your suggestion.
Do you have a practical experience with using named pipes for this? I
would love to avoid the blocking that pipes bring. If the reader fails,
the writer will get stuck once the pipe fills up. If the writer writes
two variables into the pipe, can the reader recover both of them
sequentially? That would be quite easy to do with octave-zeromq which
delivers each message payload individually, but there is no file to
Or maybe I am missing something important.
Anyway I very much appreciate your help.
I do have practical experience with named pipe - they work well for me. I didn't use them with Octave, I used them e.g.with 'ecasound'. But the mechanism is generic.
You can have named pipe per variable. You can also send a number of variables simultaneously through named pipe using Octave struct.
The fundamental rule is: first start reading the pipe in the receiving process, then send data to it in the sending process.
I also used (zero size) files as semaphores. I.e. the sending process creates such a file when data is available, and the receiving process deletes the file upon receiving the data thus notifying the sending process that new data can be prepared. But this is not necessarily related to named pipes - it's just another mechanism.