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: John W. Eaton
Subject: Re: interrupt handing and the GUI (bug #37672)
Date: Thu, 14 Nov 2013 11:46:08 -0500
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20131005 Icedove/17.0.9

On 11/13/2013 03:26 PM, Michael Goffioul wrote:

That code was not working ok either, as far as I remember. Sometimes
Ctrl-C would make octave to exit. I have an idea I'd like to experiment
with when I get some time, but in the meantime you can restore that code.

I'm not sure it makes sense to restore it.

I think we have been trying to do the impossible in the way we have
been handling SIGINT on Windows systems when we want to interrupt
external library code by doing setjmp/longjmp from the signal handler.

The Windows docs for signal handling and longjmp both specifically
state that longjmp should not be used to transfer control out of an
interrupt-handling routine unless the interrupt is caused by a
floating-point exception.

  http://msdn.microsoft.com/en-us/library/3ye15wsy%28v=vs.90%29.aspx
  http://msdn.microsoft.com/en-us/library/xdkz3x12%28v=vs.90%29.aspx

The code I removed earlier in the year was trying to be clever and
fake it by manipulating CPU registers, I think.  The code was copied
from clisp and it seems that it will only sort of work on 32-bit
Windows anway.

Unless anyone has a better suggestion, then I guess I'm back at my
idea of starting a thread for calculations that might run for a while
and then canceling them if an interrupt arrives.

We only need to use this approach on Windows systems.  The
pthread_sigmask/pthread_kill solution seems to work fine with systems
that have pthreads.  The win32 pthreads library doesn't have
pthread_kill, so that won't help us.

Meanwhile, I think we can have interrupts working reliably for
everything except long-running external library functions.

jwe


reply via email to

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