[Top][All Lists]

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

Re: Catching Figure close button - callbacks not running?

From: Pavel Hofman
Subject: Re: Catching Figure close button - callbacks not running?
Date: Wed, 30 Jan 2019 12:01:36 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1


Dne 30. 01. 19 v 9:13 Pantxo napsal(a):

When graphics callback events are fired from the GUI (main thread), they
cannot be executed right away because the interpreter (worker thread) may be
busy with some other task, so the events are stored in an event queue.

IIUC that does mean the callbacks are executed in the main worker thread and do not have a separate thread. That is how my code behaves.

here are the possible ways to execute the events:
* The interpreter is idle: every 100ms, Octave processes the eventual events
that have been stored in the queue

Does calling pause() make the interpreter idle, processing the events? While waiting in does not make the interpreter idle? That would explain the different behavior of Tony's and my code (pause() - callbacks are processed vs. zmq_poll() - callbacks are not processed).

So instead of "flush the event queue" one should read "process events in the
queue", or anything that does not mean "discard" :-).

Yes that would be a good explanation. The fact that the callback is executed by the main work thread is important IMO.

Please what would be the best practice (if any) for executing callbacks in another thread so that the main worker thread does not have to wait for the callback to finish?

I very much appreciate your help. You guys are great!



reply via email to

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