|
From: Dan K. <da...@ke...> - 2003-08-18 18:11:26
|
Dan Kegel wrote: > Jeremy Fitzhardinge wrote: > >>> Even in more complicated situations, a circular buffer between the >>> signal handler as producer and the mainline code as consumer, >>> would violate the rule about "no touching" the control pointers >>> of the circular buffer. > > Yep. In other words, there's something iffy about the > whole idea of signal handlers Arrgh. Clicked 'send' by mistake. I meant to say "classic signal handlers". The current Unix standard, http://www.opengroup.org/onlinepubs/007904975/functions/sigaction.html has this to say about the issue: "In order to prevent errors arising from interrupting non-reentrant function calls, applications should protect calls to these functions either by blocking the appropriate signals or through the use of some programmatic semaphore (see semget() , sem_init() , sem_open(), and so on). ..." - Dan -- Dan Kegel http://www.kegel.com http://counter.li.org/cgi-bin/runscript/display-person.cgi?user=78045 |