T.R | Title | User | Personal Name | Date | Lines |
---|
249.1 | All of them | GIDDAY::GILLINGS | Have we fixed it yet? | Tue Aug 29 1989 03:26 | 25 |
| Michael,
"Reentrant code" in its most general sense means that code can be
simultaneously executed by multiple execution threads. In this sense
the only real necessity is for the code to be position independent and
not modify itself. ALL VAX/VMS compilers satisfy this requirement
(maybe someone has a counter example?). If they didn't then it would not
be possible to run the same image from 2 different processes at the same
time.
Note that the above only applies to executable code, data areas are
another matter entirely. See the system services manuals regarding
"AST reentrancy" for some discussion. This area is more in the realm of
program design than a feature of a compiler.
Another possibility is that "reentrancy" is referring to the ability
to write recursive routines. This is more a matter of the language
definition than the compiler implementation. For example, VAX FORTRAN
cannot be used to write recursive routines because of the way it
allocates memory. Other languages which do allow recursion include
PASCAL, ADA, PL/1 and C.
I suspect that your customer requirements refer to the first
definition (above). In which case you can safely say that all VAX/VMS
compilers are OK. Indeed, the requirement is probably only there for
historic reasons. Some 1960's compilers from some suppliers did crazy
things like storing the return address of a subroutine call in the
first word of the routines code.
John Gillings, Sydney CSC
|
249.2 | We were one of the crazy suppliers in the 1960's | PASTIS::MONAHAN | humanity is a trojan horse | Tue Aug 29 1989 05:55 | 5 |
| The PDP-8 hardware stored "the return address of a subroutine call in the
first word of the routines code".
That didn't stop people writing compilers that handled recursive
routines, though it did make it a little more difficult.
|
249.3 | | MSAM00::MIKEWARREN | SWS Dept, Malaysia | Wed Aug 30 1989 05:21 | 3 |
| Thanks for the clarification.
Regards, Michael.
|
249.4 | VAX Fortran not as good as the others | SAUTER::SAUTER | John Sauter | Wed Aug 30 1989 14:22 | 12 |
| re: .1
In my opinion, VAX Fortran does not produce position-independent
code, because it keeps parameter addresses in static storage.
You can argue that this is a "data" issue, but the Fortran programmer
isn't dealing with data when he writes a subroutine call, so the
Fortran programmer thinks of this as "code".
There is logic in the linker to make this work in shareable images,
but the result is that portions of the image become unshareable
due to "non-PIC data".
John Sauter
|
249.5 | what kinds of reentrancy? | CASEE::PALO | �etta finnst m�r �g�tt! | Sat Sep 23 1989 11:56 | 40 |
| There are four (4) levels of reentrancy:
1 serial
2 recursive
3 AST
4 full ( or truly reentrant )
Serial Reentrancy: a serially reentrant routine must execute to
completion before it is allowed to be called again. FORTRAN routines
are usually serially reentrant.
Recursive Reentrancy: consider a routine that executes to the point of
another call to itself; it makes the call to itself (a recursive
call), and then continues to make recursive calls until a statement is
executed or a condition occurs that ends the recursion. Then, the
statements after the point of the recursive call execute, until
finally the original call completes. If *no* calls are permitted until
the original call has completed, the routine is said to be recursively
reentrant. A recursively reentrant routine is also serially reentrant.
AST Reentrancy: AST reentrancy means that at a random point duriong the
execution of a routine, an AST can occur and the routine may be
reentered ( by the AST call ). VMS normally allows only one AST to be
called at a time for any given access mode. SO, if a routine is
AST-reentrant, it may designed to permit at most two calls to be in
progress at any one time. An AST-reentrant routine is also serially
reentrant.
Full Reentrancy: routines are fully reentrant if they behave properly
when called by multiple tasks whose execution can be suspended at
arbitrary points ( and resumed in arbitrary orders ) in the routine's
code.
This information is paraphrased from the VAX Ada Programmer's Run-Time
Reference Manual (7.4.6).
FWIW
\rikki
|