Subj : Re: asynchronous cancel vs calling pthread_exit in signal handler To : comp.unix.programmer,comp.programming.threads From : Dave Date : Fri Apr 22 2005 04:17 pm so what is the general rule? (1) If I'm sure that the signal doesn't interrupt any nonasync-signal-safe functions, can I call nonasync-signal-safe function in the signal handler? The example Marc Rochkind gave in this Advanced Unix Programming book uses _exit instead of exit to terminate a process. So by saying leaving shared data in invalid state what kind of shared data is being referred to? If I used exit() instead _exit() to terminate a process in a signal handler would that possibly cause the OS or other processes to exhibit undefined behavior? thanks .