Power Of Signal Handling
Most of the software engineer / customer are fed up with their application crash. Yesterday I was thinking about the same and got some idea to get rid of this problem to some extent.
Idea is to handle signal in our program, so that our program should get resistant power to war against the bad signals.
I am not sure about whether this is possible or not.
The below snippet of code illustrate the handling of the signal SIGINT.
#include
void main()
{
...
signal( SIGINT, SIG_DFL ) // Default code get executed when the program receives SIGINT signal.
for( ;; )
...
}
We can write our own function to handle the signals in program ( instead of the default code ).
#include
void foo();
void main()
{
...
signal( SIGINT, foo ) // foo() gunction gets executed when the program receives SIGINT signal.
for( ;; )
...
}
void foo()
{
printf( " Program received SIGINT signal \n " );
}
Now the question is,
Is it possible to ignore( filter ) the signals in our program...?
Is it possible to relaunch the crashed application by catching the bad signal thrown by OS without causing any damage to user data...?
Is there any other ways to get rid of this problem...?
Idea is to handle signal in our program, so that our program should get resistant power to war against the bad signals.
I am not sure about whether this is possible or not.
The below snippet of code illustrate the handling of the signal SIGINT.
#include
void main()
{
...
signal( SIGINT, SIG_DFL ) // Default code get executed when the program receives SIGINT signal.
for( ;; )
...
}
We can write our own function to handle the signals in program ( instead of the default code ).
#include
void foo();
void main()
{
...
signal( SIGINT, foo ) // foo() gunction gets executed when the program receives SIGINT signal.
for( ;; )
...
}
void foo()
{
printf( " Program received SIGINT signal \n " );
}
Now the question is,
Is it possible to ignore( filter ) the signals in our program...?
Is it possible to relaunch the crashed application by catching the bad signal thrown by OS without causing any damage to user data...?
Is there any other ways to get rid of this problem...?
1 Comments:
interesting ... run a practical .. it looks difficult but still possibility exists
Post a Comment
<< Home