[Top][All Lists]

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

Re: assertion on Ctrl-C

From: John Darrington
Subject: Re: assertion on Ctrl-C
Date: Tue, 26 Jun 2007 12:26:02 +0800
User-agent: Mutt/1.5.13 (2006-08-11)

On Mon, Jun 25, 2007 at 08:38:14PM -0700, Ben Pfaff wrote:
     We could fix that in the procedure code.  The question is, should
     we?  If we fix the "obvious" problems with asynchronous signals,
     I'm sure that we'll just discover that there are numerous more
     subtle problems with signals, some of which only occur when PSPP
     is compiled with certain optimization flags with some compilers
     on some platforms...
     I suspect it's better to not clean up so much on Ctrl+C.  Just
     delete temporary files (if necessary) and exit.  Doing as little
     as possible in a signal handler is Good.
This is probably the best  option for now. But it might prove
inadequate in the future (for example if we have multiple threads and
multiple datasets). 

I suppose that the ideal solution would be to have a signal handler
which flags a semaphore to indicate that the code should not accept
more input, stop what it's doing and terminate.  But it's probably an
overkill ...

Another option:  Introduce a 4th state PROC_TERMINATING.
destroy_dataset sets this state which it never
leaves. proc_discard_active_file accepts this state as a valid


PGP Public key ID: 1024D/2DE827B3 
fingerprint = 8797 A26D 0854 2EAB 0285  A290 8A67 719C 2DE8 27B3
See or any PGP keyserver for public key.

Attachment: signature.asc
Description: Digital signature

reply via email to

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