Path: csiph.com!usenet.pasdenom.info!gegeweb.org!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: Sat, 29 Sep 2012 13:44:50 +0200 Lines: 21 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Trace: individual.net 20JbqOCQ3cabbGlHJ4sexAUb843THRapBLjsiSes811ohCnI5U4RjL5hVdfoZQZMtJ Cancel-Lock: sha1:13mqCOclLlT9+yDrlfWa0a2gHec= 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:1119 comp.unix.programmer:3377 > Yes. write() is async-signal-safe, so one thread can do a blocking read() > and the signal handler can use write() to wake it. Thanks for your feedback. Do you see any difficulties or software design challenges for proper handling of the situation that more data is written into the pipe than the receiving thread can read and process in a timely manner? > Lock-free algorithms require memory semantics beyond those specified in > the C and POSIX standards. E.g. they typically require the use of a memory > barrier (fence). I hope that the support for this use case will be improved by the current (and following) standard version for the programming languages C and C++. http://en.wikipedia.org/wiki/C++11#Threading_facilities Regards, Markus