I run through my system's source codes and I notice that this is often done for application programs or process that uses motif but it is also used for some other processes that perform serial port communication. Recently, I have written a motif application for a GSM server and I am also using their piping methods but now I am questioning the purpose/wisdom of doing it.
Its basically a 5 steps procedure
1)Do the standard signal declarations
2)Open a pipe
3)Create a signal handler for a particular signal eg SigUSR1
4)If the handler is provoked, write something(can be anything) into the pipe, chain the old handlers
5)Read the pipe and if there is something in there, do something, mostly cross-server processes.
Isn't it easier to use the standard signal handlers and do a case statement to decide what to do for each received signals?
Is it possible that the original authors wanted to avoid too much handling codes for different signals so they decided to simply create a pipe for single signal handling? I believe they are doing this for some good reasons because they are doing this for almost all the processes. I may sounds a bit stubborn but I am really very curious and very interested to get an answer for this.
I have tried to ask one of them(there are not many left) but he could not give me a good answer