Multithreaded GUI applications in Octave?
MS-BOSS wrote 01/24/2020 at 14:05 • 1 pointHi, has anyone ever tried to run two threads/processes of Octave scripts and have them connected in some way? I would like to separate GUI from its backend, because the backend postpones reactions of the GUI until it does its job with communicating over USART and calls a method which runs all pending callbacks and redraws the GUI.
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.
I'm not sure if this is exactly what you're after, but maybe it generates some useful ideas. I have used Octave as a repetitively called child process in a Perl script. Perl uses the Octave stdout to read arrays of data that the Perl script sends to other devices, one element at a time, until it is mostly exhausted, and then refreshes it's cache of data by calling the Octave script again. The cache refresh happens asynchronously in a thread that populates a FIFO queue that the foreground Perl code reads according to it's own need. In my case the foreground process is dealing with socket-connected clients, but it could just as easily be plotting the Octave data, or setting GUI widgets like sliders and knobs.
Are you sure? yes | no
Yes, but not with a gui. Assuming you're in Linux, I use a shell script to manage multiple octave instances. Data is passed between them as text files. Probably not suitable for your requirement if you want a fast refresh rate but something I've mentioned may spark a useful thought.
Are you sure? yes | no
Thanks, I thought of this way of interfacing, but that seems to me to have too much overhead. If I had to use some approach which is not directly implemented in Octave, I would use sockets for communication, but that still sounds like overkill.
Are you sure? yes | no