Skip to main content

Posts

Showing posts from December, 2012

Not handling signals degrades performance

Signals are asynchronous software interrupts that usually happen due to users or utilities sending signals to processes, hardware exceptions within applications, and conditional statements within applications. Most applications do not handle signals because programmers are told "error checking" means checking return values, e.g. does a function return 0 or -1? When an application doesn't handle signals, it relies on the kernel to do what it thinks is best for an application and the application's data after an error occurs. Sometimes an error is returned to the user, other times the problem is ignored. That's because kernels react to categorized errors, not to specifc errors caused by every imaginable application.    Some interesting and hard to find performance issues arise when applications do not handle signals, such as an accumulation of lost i-nodes, race conditions between statements, random data corruption and other unexpected behavior. A lot of perform