octave-maintainers
[Top][All Lists]
Advanced

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

GUI forced exit when core thread is busy/frozen


From: Daniel J Sebald
Subject: GUI forced exit when core thread is busy/frozen
Date: Sun, 26 Apr 2015 03:51:16 -0500
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.24) Gecko/20111108 Fedora/3.1.16-1.fc14 Thunderbird/3.1.16

At this bug report:

https://savannah.gnu.org/bugs/?44485

we've been trying to piece together an acceptable way to force exit from the GUI when the core is busy or frozen. It seems that such a thing is needed because

* With the GUI there is now the ability to select exit from the File dropdown menu. Doing nothing if the interpreter is busy processing doesn't seem correct.

* If the core freezes, it would be nice to have the capability to force exit rather than the user have to use the system to kill the process.

The question is what exactly to do.

First, let me provide some details which I think are a good approach.

1) Exiting, as of a couple months ago, now takes a path via the interpreter for both the user typing "exit" and the user selecting "Exit" from the File dropdown menu (or Cntrl-Q). That is, every proper exit follows the same code path. That's just good practice. Hence the proper shutdown is to go to the interpreter, execute exit/quit, which goes back to the GUI and confirms it should shutdown (i.e., check open files), then the core does its shutdown followed by the GUI doing its shutdown.

2) If the user selects File:Exit, a timer is started and if after three seconds the core doesn't respond to the exit with the shutdown inquiry, a dialog is shown indicating the core is busy and asking if the user wants to force an exit.

What is "force exit"? How should it respond? Although it might seem logical, I'm reluctant to issue a terminal_interrupt (break the core out of its processing) followed by another exit. The reason is that could lead to an infinite loop if the core is actually frozen and a terminal_interrupt doesn't break out to the command line.

Right now the changeset candidate issues a terminal_interrupt, followed by quitting the interpreter thread. This is not graceful because it does a backtrace sometimes, but not always (see bug report). I think the reason is that quitting the interpreter thread and GUI exiting is sort of a race so it isn't assured which comes first. Should there be a backtrace with forced exit? If so, I'm assuming we want to make sure it always appears in the OS terminal (or nowhere if the user launched from the desktop). Should there be no backtrace, which seems cleaner but less informative in the case of freeze?

Before trying to program one way or another, I'd like some opinion on what is preferred.

Dan



reply via email to

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