3 ms·
>> Except that once you do this, no one else can listen for that signal anymore. > What do you mean by that? Who else is there other than the process being sig
by kstenerud 5y ago
>> Except that once you do this, no one else can listen for that signal anymore.
> What do you mean by that? Who else is there other than the process being signaled?
A library that needs to be notified of certain signals and perhaps also their contents.
- matheusmoreira 5y agoYeah, that's going to be a huge problem. Libraries shouldn't be doing that. They should leave signal handling to the caller and provide the functions that should be called in those cases. Just like memory allocation, initialization...
- kstenerud 5y agoWhich is great in theory, except that signal handlers are such an esoteric body of knowledge that very few people can do it at all, let alone do it properly. So, many libraries do it for them (which works so long as nobody uses the blocking or blocking-dependent APIs - which is generally true). Even the JVM taps SIGQUIT for dumping process info.
- R0b0t1 5y agoThe workaround for this you can find in SDL2 and some other libraries with event loops is having a default, library-provided setup routine and event loop. Know what you're doing? Set up signals yourself. Don't? Library sets it up for you.