Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!de-l.enfer-du-nord.net!feeder2.enfer-du-nord.net!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Markus Elfring Newsgroups: comp.programming.threads,comp.unix.programmer Subject: Re: Safe accesses of global arrays in signal handlers? Date: Fri, 28 Sep 2012 13:48:40 +0200 Lines: 16 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Trace: individual.net C5ALnlKQ4ybAvbXMXL3IuglssYghvyxfjNMWFNckFXnr5EChqit848gPJwQ/P+iXcp Cancel-Lock: sha1:aVcmJQ/VcN34Hplu0y99Kx26/fs= User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:15.0) Gecko/20120825 Thunderbird/15.0 In-Reply-To: Xref: csiph.com comp.programming.threads:1107 comp.unix.programmer:3362 > Doing anything substantial in a signal handler is problematic. Are the following approaches valid software design options for the discussed use case? 1. "Self-pipe trick" that was described by Daniel J. Bernstein. http://cr.yp.to/docs/selfpipe.html 2. Are lock-free algorithms applicable like an implementation is described in the article "Signal-Safe Locks"? http://locklessinc.com/articles/signalsafe_locks/ http://en.wikipedia.org/wiki/Non-blocking_algorithm Regards, Markus