Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!feeder2.ecngs.de!ecngs!feeder.ecngs.de!news.osn.de!diablo2.news.osn.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Rainer Weikusat Newsgroups: comp.programming.threads,comp.unix.programmer Subject: Re: Signal handlers writing into pipes Date: Wed, 03 Oct 2012 17:07:35 +0100 Lines: 16 Message-ID: <87zk435yk8.fsf@sapphire.mobileactivedefense.com> References: <87txuep1iz.fsf@sapphire.mobileactivedefense.com> <506C4D6D.2090809@web.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: individual.net H+eagnsGl9fOD4v0dl/6uAc709UqhgT/CbAYRvlzQRHSUbH5Q= Cancel-Lock: sha1:Oo2IYJze9i3e1KdfJoli8pLUZhc= sha1:bSWmvQiKXYmX6bUNuCtzvlJkf4s= User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.2 (gnu/linux) Xref: csiph.com comp.programming.threads:1167 comp.unix.programmer:3454 Markus Elfring writes: >> Technically, when the program is receiving signals so fast that it >> doesn't get around to processing them anymore, that's a livelock and >> in this case, something has to be dropped on the floor in order to >> restore the ability to make forward progress. Consequently, just >> setting the pipe descriptor to non-blocking and ignoring EAGAIN in the >> signal handler might be a sensible approach, especially considering >> that this is unlikely to happen for typical uses of signals. > > Can the probability for a live-lock be reduced if a named pipe would be used > instead of an anonymous one? No because this is not a buffering problem. It just means that the pipe buffer fills up because signals are persistently arriving faster than the appplication code outside of the signal handler can process them.