help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Passing variables between octave processes on the same machine


From: Sergei Steshenko
Subject: Re: Passing variables between octave processes on the same machine
Date: Sun, 20 Jan 2019 18:54:21 +0000 (UTC)



On Sunday, January 20, 2019, 7:51:25 PM GMT+2, Pavel Hofman <address@hidden> wrote:


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.
>

Hi Sergei,

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
'load' from...

Or maybe I am missing something important.

Anyway I very much appreciate your help.


Best regards,

Pavel.

===========================================

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.

--Sergei.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]