From: Nix <ni...@es...> - 2002-11-25 20:38:11
|
On Sun, 24 Nov 2002, Paul Kienzle said: > The reason that won't work is because you need to something to catch it. But the catcher is in octave/toplev.cc; it throws right through our code and out the other side. (I'm sort of assuming that our destructors do all the necessary cleanup; if not, we'll need the occasional catch-and-rethrow ourselves.) Of course this code only handles errors, not interrupts. For that, see below :) > That requires putting trapping code around each call to superLU to set > the jump return address and reset it when done. Plus any loops outside > of superLU need to have periodic checks if an interrupt has been triggered. ... oh, damn and blast, SuperLU is C. I didn't notice and thought it was C++. OK, C that counts as foreign code, so calls into SuperLU will require BEGIN_INTERRUPT_IMMEDIATELY_IN_FOREIGN_CODE / END_INTERRUPT_IMMEDIATELY_IN_FOREIGN_CODE wrapped around them. That should let the code flow when interrupted by SIGINT within SuperLU go SIGINT -> signal handler in octave's src/sighandlers.cc -> octave_jump_to_enclosing_context() -> longjmp() to the END_INTERRUPT_IMMEDIATELY_IN_FOREIGN_CODE -> Octave's toplev.cc. > The macros to do this are in quit.h, but I don't know the exact magic. I think I've decrypted it. > Let me know if you are going to persue this, because it is top of my list It's top of mine too. Patch in an hour or so (this box is running rather slowly right now, alas, and it would be inurbane for me to antinice everyone else into oblivion). > (right behind family and work that is, which in this season puts it > much too far back ;-) :) -- `I keep hearing about SF writers dying, but I never hear about SF writers being born. So I guess eventually there'll be none left.' -- Keith F. Lynch |