Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: utzoo!watmath!clyde!burl!ulysses!cbosgd!ucbvax!decvax!mcnc!rti!rti-sel!rcb
From: rcb@rti-sel.UUCP
Newsgroups: fa.info-vax
Subject: Re: Detached processes
Message-ID: <1196@rti-sel.UUCP>
Date: Fri, 14-Sep-84 09:41:46 EDT
Article-I.D.: rti-sel.1196
Posted: Fri Sep 14 09:41:46 1984
Date-Received: Tue, 25-Sep-84 02:40:03 EDT
References: ucbvax.1859
Lines: 33


	First, the real problem with using shared images for common
data, is that to use them globally, you must install them. Then, anyone
can link to the shared image and access it. Your problem is probably
that you are not installing it. A better way is use a global section
that is mapped to a file. If you make a structure that has all
the data that you want to share and declare a global instance of that
structure, it will be given it's own psect by the linker. Then, you
set the psect's attribute to page alignment in the linker options file.
When the program runs, the first thing that it does is to call
Create and Map Global Section system call to map a file onto the
memory that is occupied by the structure. This will automatically
unmap the normal virtual memory and map the file onto that area and
the pager will handle all the updates to the file. Also the file
can be changed by just calling the system routine with a new file
and it will write out the current data, map the new file in, and
all the processes linked to it will have the new data. The best thing,
however, is that the file protection is still in effect and you
can control who gets access to the data.

	Secondly, the image is not position independent because of the
way the compiler handles global variables. Each global variable is
allocated it's own psect with the attributes of overlay and share and
nopic. Any references to this variable are defined exactly the same
way. When linked, the linker resolves these references and everything
works nicely. Except if you want to do anything fancy, like pic
code or shared code images. Oh, well. If you want to do anything
like that, use a real language. Like Fortran, or Pascal, or
my personal favorite, the MIGHTY MACRO-32.

					Randy Buckland
					Research Triangle Institute
					...!mcnc!rti!rcb