Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!cs.utexas.edu!swrinde!mips!daver!tscs!tct!chip From: chip@tct.uucp (Chip Salzenberg) Newsgroups: comp.lang.c++ Subject: Re: C++ and UNIX Signals. Message-ID: <26D031A9.3036@tct.uucp> Date: 20 Aug 90 17:02:49 GMT References: <1699@dinl.mmc.UUCP> Organization: Teltronics/TCT, Sarasota, FL Lines: 17 According to noren@dinl.UUCP (Charles Noren): >How reentrant is C++ code? Suppose you have a class >(lets call it the infamous class foo), and you perform >a new on it, and suddenly a signal throws you into >your signal handler which also also does a new on foo [...] Bzzt! You lose the portability sweepstakes. About the only portable thing you can do in a signal handler is set a flag of type sig_atomic_t (as defined in ), or a plain int if you don't have a definition for sig_atomic_t. In general, doing memory management in a signal handler is a Very Bad Idea. -- Chip Salzenberg at Teltronics/TCT ,