octave-bug-tracker
[Top][All Lists]
Advanced

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

[Octave-bug-tracker] [bug #44485] GUI: File | Exit from main menu doesn'


From: Dan Sebald
Subject: [Octave-bug-tracker] [bug #44485] GUI: File | Exit from main menu doesn't work when Octave is busy
Date: Sun, 08 Mar 2015 19:57:23 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:18.0) Gecko/20100101 Firefox/18.0 SeaMonkey/2.15

Follow-up Comment #8, bug #44485 (project octave):

"I'm not sure about the delayed timer-based idea, wouldn't it be better to
just detect whether Octave is busy at the time the user tries to exit and show
the dialog then?"

Yes, sure, but again there are limitations with communications here.  I'm
unaware of a way right now to inquire of the Octave core thread "are you
computing something or just sitting idle"?  That is what the "exit" in the
queue does, in some sense.  If the "exit" gets processed immediately then
Octave isn't doing anything.  But we have to allow a short period of time for
Octave core to come back and initiate the shutdown otherwise there will be an
annoying race condition where the GUI says "Octave is busy" and then also a
dialog appears "Save this file", etc.  Make it one second or a half second, if
three seconds is too long for someone who launched a three minute processing
job.

Do we want to have some type of variable in memory--a mutex of sorts--for
which the core Octave processor sets one way when it is busy and sets another
way when it is not busy so that the GUI can check that value?  That doesn't
feel like a good solution to me.  If the core is busy, it can't tell us it's
busy unless every few microseconds it checks to see if it should communicate
with the GUI, but that's a waste of CPU cycles really--another not-so-elegant
solution.

A good design is needed for an environment with two threads and asynchronous
events.  That's post-4.0.


    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?44485>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

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