Don Poitras wrote:
In article <4b8389b7.9030...@gmail.com> you wrote:
Charles Mills wrote:
The fundamental problem I guess is that any solution that keeps a pointer
around "somewhere in the code" is fundamentally not reentrant, unless I can
figure out how to utilize pseudo-registers. I've heard the term
pseudo-register for years but I have never delved into them. Perhaps now is
the time.


You're fundamentally not reentrant if you use any kind of global data. That may be name/tokens, control block anchors or WSA. That may not be a problem for you if you only want one instance of the routine. I prefer to design C++ applications to use objects which can handle multiple instantiations of the same class even if I only need one instance. You never know when that requirement may change.

The purpose of WSA is to provide reentrancy. Every copy of the program
will get it's own WSA initialised when the program starts. No different
than in assembler where you do a GETMAIN and use MF=L macros.


The purpose of WSA is to provide constructed reentrancy for main programs that may in common storage like LPA. As a programming model it's global data. Global data is questionable in good design if you can avoid it.


RELATED: is anyone using void *__malloc24(size_t size);? If you code it then
it does not compile; if you code your own declaration then it does not link.
At least not in my code. Yes, I included <stdlib.h>. Obviously, not a big
deal to write an assembler GETMAIN routine, but still ...

Charles


----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@bama.ua.edu with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html

Reply via email to