[Top][All Lists]

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

Re: Catching Figure close button - callbacks not running?

From: Pantxo Diribarne
Subject: Re: Catching Figure close button - callbacks not running?
Date: Fri, 1 Feb 2019 15:41:58 +0100

Le 31/01/2019 à 16:17, Pavel Hofman a écrit :
Dne 30. 01. 19 v 14:05 Pantxo Diribarne napsal(a):

Can you sketch a little more precisely what your are trying to do (or point me to a relevant thread if you already did)?

* a figure UI with several pushbuttons and text fields

* a thread which loop receiving zeromq messages, every 200ms. Most messages results in some data shown in the UI. This thread can be paused for a bit longer, but no more than e.g. 500ms to make sure the displayed data are up-to-date.

* callbacks hooked to the UI pushbuttons. Each callback runs a sequence of commands separated by some waiting (using fixed pause() now, but will be replaced with waiting for acknowledgement msgs through zeromq). Each callback runs several seconds.

IIRC the parallel package works with a bunch of independent Octave sessions (each one having its own interpreter) communicating with each other through files or pipes or some kind of shared memory. Am I right? If so when a figures is instantiated from one of those "sessions" (probably the main one, the one that spawns other processes), the figure callbacks must be executed by the associated interpreter.

If that is the case, I cannot use the parallel package since all my "threads" need to update the shared UI.

However, since my callbacks will have to wait for the feedback received through the zeromq messages (instead of "dumb" pausing), the solution will have to implement some finite state machine anyway, running in the single interpreter thread and run it completely in the same loop the zeromq messages are being read. Pause is easy to implement with checking whether enough time has already passed. The way e.g. small single-thread microprocessors (arduino) are programmed.

Thanks a lot for your invaluable help, to all of you.


I never used the parallel package but I was under the impression that it was mainly a parallel implementation of (par)arrayfun, (par)cellfun ... And I am pretty sure you cannot affect the state of the figure, which lives in the main process, by calling those functions.


reply via email to

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