Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!eternal-september.org!feeder.eternal-september.org!news.swapon.de!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: Sun, 30 Sep 2012 13:12:27 +0200 Lines: 14 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Trace: individual.net ne9EZwfFNHVtK2tHqH8RaAwCb9PkX5xQXTMLDPkDoQJXwIbSt2IiB57rBDrwTyDk65 Cancel-Lock: sha1:Fu2uZRlvSD03mcuZz2XG/2GXZbQ= 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:1124 comp.unix.programmer:3386 > The signal handler only needs to write one byte at a time; > the receiving thread can read a pipe-full at a time. If the receiving > thread does nothing but notify worker threads or enqueue messages, > there shouldn't be a problem. Is it a software design challenge to forward the number that was passed to this callback function into the dedicated pipe? Does the conversion of the signal number from an integer to a single character mean an interesting portability issue if you would like to use it as an index for an array? (What would be the maximum value in this use case?) Regards, Markus