|
From: | Michael Goffioul |
Subject: | Re: interrupt handing and the GUI (bug #37672) |
Date: | Thu, 14 Nov 2013 12:07:23 -0500 |
On 11/13/2013 03:26 PM, Michael Goffioul wrote:I'm not sure it makes sense to restore it.
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 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.
[Prev in Thread] | Current Thread | [Next in Thread] |