Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!columbia!rutgers!ucla-cs!ames!ucbcad!ucbvax!YALE.ARPA!LEICHTER-JERRY From: LEICHTER-JERRY@YALE.ARPA Newsgroups: comp.os.vms Subject: Re: Re-entrant code Message-ID: <8704210356.AA10095@ucbvax.Berkeley.EDU> Date: Mon, 20-Apr-87 22:56:45 EST Article-I.D.: ucbvax.8704210356.AA10095 Posted: Mon Apr 20 22:56:45 1987 Date-Received: Wed, 22-Apr-87 00:33:13 EST Sender: daemon@ucbvax.BERKELEY.EDU Reply-To: Distribution: world Organization: The ARPA Internet Lines: 22 As I once again learned, you have to disable interrupts (e.g. with a SYS$SETAST call) before calling non-re-entrant routines if AST routines also call them. This is (obviously) to prevent the data structures in the non-re-entrant code from getting trashed. So what's the concern: is it possible to write re-entrant code on a VAX in higher level languages like FORTRAN? If so, are there guidelines writ- ten anyplace? Thanks to all who reply. In general, you have to avoid using any statically-allocated storage. In FORTRAN, this is mainly stuff in COMMON. Note, however, that the FORTRAN OTS is not all AST-reentrent - the I/O system, in particular. (The same is true of most language OTS's - C, for example.) For TONS of details, read the Guide to Creating Modular Procedures on VAX/VMS - a gem of a "good software engineering principles and practices" book hidden away in the VMS documentation. Section 3.3 is titled "Writing AST-Reentrant Code". -- Jerry -------