octave-maintainers
[Top][All Lists]
Advanced

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

Re: interrupt handing and the GUI (bug #37672)


From: Daniel J Sebald
Subject: Re: interrupt handing and the GUI (bug #37672)
Date: Sun, 10 Nov 2013 12:44:13 -0600
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

On 11/10/2013 12:25 PM, Daniel J Sebald wrote:
On 11/10/2013 11:07 AM, John W. Eaton wrote:
I have marked bug 37672 (https://savannah.gnu.org/bugs/?37672) as a
blocker for the release. I have some ideas about why this is not
working and what we can do to fix it.

In the CLI version of Octave, the terminal driver sends a SIGINT
signal to the Octave process when the user types Ctrl-C at the
command prompt. Then the SIGINT signal is caught and we end up in the
function user_abort.

In the GUI, typing Ctrl-C in the terminal window doesn't generate a
SIGINT signal directly as it does when Octave is running in a
terminal. Instead, it eventually calls the function
TerminalView::copyClipboard (in the Unix version of the libqterminal
code) or QWinTerminalImpl::copyClipboard (in the Windows version of
the libqterminal code). Then, if there is no selection, we call
::raise (SIGINT) to generate an interrupt signal for the process.
From there, we end up in user_abort.

Ignoring things like "debug_on_interrupt", the function user_abort
may do one of two things to handle the signal.

The first is to set the global variable octave_interrupt_state and
return. Then Octave periodically checks this variable (typically
using the OCTAVE_QUIT macro) and if it is set, throws an exception and
returns to the command prompt.

Instead of octave_interrupt_state, maybe there could be two threads in Octave core: one whose main purpose is to handle signal and thread flow, the other being the main Octave-core thread as it currently exists.

Dan


reply via email to

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