| Deutsch English Français Italiano |
|
<vni4br$3ehhv$1@dont-email.me> View for Bookmarking (what is this?) Look up another Usenet article |
Path: ...!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!eternal-september.org!.POSTED!not-for-mail From: Muttley@DastardlyHQ.org Newsgroups: comp.unix.programmer Subject: Re: signal handling issues Date: Fri, 31 Jan 2025 09:15:39 -0000 (UTC) Organization: A noiseless patient Spider Lines: 29 Message-ID: <vni4br$3ehhv$1@dont-email.me> References: <874j1g18x2.fsf@doppelsaurus.mobileactivedefense.com> <tBPmP.1043754$2xE6.1002585@fx18.iad> <20250130114503.356@kylheku.com> Injection-Date: Fri, 31 Jan 2025 10:15:39 +0100 (CET) Injection-Info: dont-email.me; posting-host="34c61fdd2f6ee31f1774de7c26aabd9e"; logging-data="3622463"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19Sq2fFGWPWnF4t+kv9smZc" Cancel-Lock: sha1:rN8Koi+J+CvlU/PaFo2Xqw23xow= Bytes: 2129 On Thu, 30 Jan 2025 19:49:58 -0000 (UTC) Kaz Kylheku <643-408-1753@kylheku.com> wibbled: >On 2025-01-30, Scott Lurndal <scott@slp53.sl.home> wrote: >> Rainer Weikusat <rweikusat@talktalk.net> writes: >>> If the process is multi-threaded, or if the process is >>> single-threaded and a signal handler is executed other than as >>> the result of: >> >> While Geoff may chime in with the definitive answer, once >> multithreading was introduced, the stdio library functions >> were required to synchronize access to the underlying >> FILE buffers between threads. > >But the requirement applies to a single-threaded program in >which an asynchronous signal occurs. > >The multi-threaded case seems to say that if the program is MT, >then if a signal occurs even as a result of the program >calling raise, etc, it is effectivecly an async signal >(since it happens as the result of a thread executing >asynchronously with regard to whatever thread catches the signal >via a handler.) 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.