Liste des Groupes | Revenir à cu programmer |
In article <vljcbk$27v6l$1@dont-email.me>, <Muttley@DastardlyHQ.org> wrote:On Tue, 7 Jan 2025 13:18:54 -0000 (UTC)a
cross@spitfire.i.gajendra.net (Dan Cross) wibbled:In article <vlip2c$24ccb$1@dont-email.me>, <Muttley@DastardlyHQ.org> wrote:On Mon, 06 Jan 2025 16:46:56 GMT
ITYF it is VERY widely shared and having a signal safe API function is only
step 2 - plenty of the functions in the program itself or 3rd party library
functions are probably not re-entrant safe and even if they are, having
code stomp over itself - eg if in the middle of writing a log message then>>signal is generated which tried to write a log message itself - is a very>
poor way to write code.
So don't write code that way. It does not follow that the only
thing you can do in a signal handler is an some atomic flag
somewhere.
Just because you can doesn't mean you should. C lets you do a lot of things
that are a Bad Idea.
I have to ask at this point: have you ever written a concurrent
program under Unix? One that used signals? For that matter,
have you ever written a program that used `fork()` and caught a
`SIGCHLD`?
Les messages affichés proviennent d'usenet.