home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / os / vms / 19355 < prev    next >
Encoding:
Internet Message Format  |  1992-12-15  |  2.1 KB

  1. Path: sparky!uunet!olivea!charnel!rat!usc!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!ucbvax!NSCVAX.PRINCETON.EDU!dragon
  2. From: dragon@NSCVAX.PRINCETON.EDU (Mighty Firebreather)
  3. Newsgroups: comp.os.vms
  4. Subject: RE: SMG$ routines: Just how non-reenterent are they?
  5. Message-ID: <009651EA.379C84C0.29260@nscvax.princeton.edu>
  6. Date: 15 Dec 92 15:14:50 GMT
  7. Sender: daemon@ucbvax.BERKELEY.EDU
  8. Organization: The Internet
  9. Lines: 36
  10.  
  11.  
  12.     Chris Kushmerick <kushmer@bnlux1.bnl.gov> writes:
  13. >
  14. >The manual says that SMG$ is not reenterent (spelling?).
  15.  
  16.     That's "reentrant".
  17. >
  18. >Does this mean that I should disable ASTs from occuring arounds each smg call
  19. >if my program uses AST routines triggered by timers, $qios et cetera?
  20. >
  21. >Or does it only mean that I should not do any SMG routines in any ASTs that may
  22. >interrupt a SMG routine?
  23. >
  24.  
  25.     It means that you must code your program so that there is *NO* 
  26. possibility of SMG$ routines (or data structures) being used from *both* 
  27. the main line of your program and AST level.  SMG$ used from AST level will 
  28. crap all over what SMG$ is doing in the main line.
  29.  
  30.     In general, reentrant code is defined as code that does not modify 
  31. the contents of any storage location that is not unique to that invocation 
  32. of the code.  The expression "storage location" includes registers.  
  33. Reentrant code must save and restore the contents of any register it 
  34. modifies.
  35.  
  36.     If this condition is met, the code can be interrupted at any 
  37. point, executed from start to finish using another context, and resume 
  38. execution in the initial context with nothing lost or corrupted.
  39.  
  40. *************************************************************************
  41. *                                                                       *
  42. *                        Here, there be dragons!                        *
  43. *                      dragon@nscvax.princeton.edu                      *
  44. *                                                                       *
  45. *                                                Richard B. Gilbert     *
  46. *************************************************************************
  47.