[openib-general] opensm and signals

Michael S. Tsirkin mst at mellanox.co.il
Mon Sep 12 00:39:55 PDT 2005


Hi, Hal, Eitan!
Whats the reason opensm needs to catch and try to handle signals such as SIGINT?
It seems that we can let the default handler simply kill the application.
If this is required for some vendor layer, shouldnt the signal
handling be part of that vendor layer?

Please note that glibc manual says

http://www.gnu.org/software/libc/manual/html_node/Defining-Handlers.html

"You need to take special care in writing handler functions because they
can be called asynchronously. That is, a handler might be called at any
point in the program, unpredictably."

and

"The best practice is to write a handler that does nothing but set an
external variable that the program checks regularly, and leave all
serious work to the program."

Based on this, I really wander whether its best to avoid signal handlers
altogether, if possible.

Thanks,

-- 
MST



More information about the general mailing list