HP3000-L Archives

July 1995, Week 4

HP3000-L@RAVEN.UTC.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Stan Sieler <[log in to unmask]>
Reply To:
Stan Sieler <[log in to unmask]>
Date:
Sat, 22 Jul 1995 14:10:05 -0700
Content-Type:
text/plain
Parts/Attachments:
text/plain (43 lines)
MoyerScott writes:
 
> I must admit that our staff is puzzled by the description of Shared Global
> Data also.  We are not sure if it refers to variable space reserved in the
> XL, RL, or program data space.  If it only applies within a single
> process, how is it different than traditional variables declared global in
> scope??   I too would like clarification of this new feature in 5.0
 
The major problem of understanding the 5.0 "Shared Global Data" is that
the name is a terribly misleading one.  When I first heard of it,
I thought:  "oh good, a method of for separate processes to share
data simply (without mapped files) ... like we could do on Burroughs MCP
back in '78" ... but, no ... it isn't that.
 
Shared Globals allows a library (e.g., an XL) to "find" a global data item
in a process' data area.  Thus, for example, one could have an XL
that says:
 
   extern int users_age;
 
and then, when the user's process declares the variable:
    int users_age;
    ...
    users_age = 8;
 
and is loaded with that library, the library's references to "users_age"
will point to the same "users_age" variable that is in the user's global
data area.
 
Shared Globals allows the above (providing the program is linked with ;SHARE
and the XL is built with ;SHARE) .. and the opposite as well (where the
variable is declared as "extern int users_age" in the main program,
and "int users_age" in the procedure that goes into the XL).
 
(Note: I tested this today, seems to work.)
 
Traditional "global" variables must be resolved at link time ... not
run time.
 
--
Stan Sieler                                          [log in to unmask]
                                     http://www.allegro.com/sieler.html

ATOM RSS1 RSS2