home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / lang / c / 11484 < prev    next >
Encoding:
Internet Message Format  |  1992-07-22  |  1.7 KB

  1. Path: sparky!uunet!mcsun!fuug!demos!kiae!glas!demos!oracle.us!us.oracle.com!wkaufman
  2. From: wkaufman@us.oracle.com
  3. Newsgroups: comp.lang.c
  4. Date: 18 Jul 92 20:46 MDT
  5. Subject: Re: Handling signals (was:  trappin
  6. Sender: Notesfile to Usenet Gateway <notes@glas.apc.org>
  7. Message-ID: <1992Jul18.164658.14314@oracle.us>
  8. Nf-ID: #N:1992Jul18.164658.14314@oracle.us:2096584799:001:1278
  9. Nf-From: us.oracle.com!wkaufman    Jul 18 20:46:00 1992
  10. Lines: 27
  11.  
  12.  
  13. In article <1992Jul17.141248.4837@mdd.comm.mot.com> mitchell@mdd.comm.mot.com (Bill Mitchell) writes:
  14. ] Looking in PJP's "The Standard C Library", chapter 9, I see that he goes on
  15. ] at some length about syncronization and other problems which can occur in
  16. ] handling signals.  In part, he says:
  17. ]   The occurence of a signal introduces a second thread of control within
  18. ]   a program.  That raises all sorts of issues about syncronization and
  19. ]   reliable operation.  The C Standard promises little in either regard.
  20. ]   C programs have been handling signals since the earliest days of the
  21. ]   language.  Nevertheless, a portable program can safely take very few
  22. ]   actions within a signal handler.
  23.  
  24.     OK, so this just says that the signal handler should be *very*
  25. careful about touching global variables, right?  Doing nothing,
  26. exit()'ing, or writing to a variable that the main program only reads
  27. from (or vice versa)--these should all be safe, right?
  28.  
  29.     Is there anything else that would be guaranteed to work?
  30.  
  31.                                            -- Bill K.
  32.  
  33. Bill Kaufman,          | "Hush my darling / Be still my darling /
  34. Corporate Lackey       |  The lion's on the phone,..."
  35. wkaufman@us.oracle.com |              -- "The Guitar", They Might Be Giants
  36.  
  37.