Sujet : Re: signal handling issues
De : rweikusat (at) *nospam* talktalk.net (Rainer Weikusat)
Groupes : comp.unix.programmerDate : 04. Feb 2025, 19:55:25
Autres entêtes
Message-ID : <87cyfxee02.fsf@doppelsaurus.mobileactivedefense.com>
References : 1 2 3 4 5 6
User-Agent : Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux)
Muttley@dastardlyhq.com writes:
Lawrence D'Oliveiro <ldo@nz.invalid> gabbled:
On Fri, 31 Jan 2025 09:15:39 -0000 (UTC), Muttley wrote:
>
All this confusion and complexity is why I always recommend that in a
multithreaded program if you must use signals then all signals should be
blocked with a single thread dedicated to sitting in sigwait() and handling
whatever comes along.
>
Or use signalfd(2) <https://manpages.debian.org/signalfd(2)>.
>
I never knew about that, very useful! Unfortunately it appears to be linux
only.
I've started to use it exclusively in the last couple of larger programs
I wrote for my employer.