home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!olivea!charnel!rat!usc!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!ucbvax!NSCVAX.PRINCETON.EDU!dragon
- From: dragon@NSCVAX.PRINCETON.EDU (Mighty Firebreather)
- Newsgroups: comp.os.vms
- Subject: RE: SMG$ routines: Just how non-reenterent are they?
- Message-ID: <009651EA.379C84C0.29260@nscvax.princeton.edu>
- Date: 15 Dec 92 15:14:50 GMT
- Sender: daemon@ucbvax.BERKELEY.EDU
- Organization: The Internet
- Lines: 36
-
-
- Chris Kushmerick <kushmer@bnlux1.bnl.gov> writes:
- >
- >The manual says that SMG$ is not reenterent (spelling?).
-
- That's "reentrant".
- >
- >Does this mean that I should disable ASTs from occuring arounds each smg call
- >if my program uses AST routines triggered by timers, $qios et cetera?
- >
- >Or does it only mean that I should not do any SMG routines in any ASTs that may
- >interrupt a SMG routine?
- >
-
- It means that you must code your program so that there is *NO*
- possibility of SMG$ routines (or data structures) being used from *both*
- the main line of your program and AST level. SMG$ used from AST level will
- crap all over what SMG$ is doing in the main line.
-
- In general, reentrant code is defined as code that does not modify
- the contents of any storage location that is not unique to that invocation
- of the code. The expression "storage location" includes registers.
- Reentrant code must save and restore the contents of any register it
- modifies.
-
- If this condition is met, the code can be interrupted at any
- point, executed from start to finish using another context, and resume
- execution in the initial context with nothing lost or corrupted.
-
- *************************************************************************
- * *
- * Here, there be dragons! *
- * dragon@nscvax.princeton.edu *
- * *
- * Richard B. Gilbert *
- *************************************************************************
-