I have a program that creates many threads and runs until either power is shutdown to the embedded computer, or the user uses kill or ctrlc
1. Is any signal handling necessary?
2. Are there any other signals that I need to be concerned with regarding clean termination?
First, take a look at his page : The GNU Library Signals The termination signals is what you look after. But take a look at SIGUSR1 and SIGUSR2, even if you 'll never find them in any software, except for debugging purposes.
All of this termination signals need to be handled if you don't want your soft to terminate all of a sudden.
3. Does the terminate variable in my example have to be volatile?
4. I've read that
signal()is now deprecated, and to usesigaction()
Sigaction() is POSIX while signal is a C standard.
Signal() works fine for me, but if you want any example : IBM Example