in reply to Re: the unsafe signals controversy
in thread the unsafe signals controversy
Fork, execute operation in new process p2 which will update a file or some shared ipc on completion. P1 has a signal handler that will notify 'p1' if it was interrupted in a 'safe' area.
In p1, use the alarm signal to 'timeout' p2. If update was not performed yet, send a SIGTERM (followed by a SIGKILL if necessary).try again.
it is a kludge and not 100% full proof, but works ok in all the tests I've performed so far.
|
|---|