[comp.unix.internals] Mapping Virtual address spaces

jb107@prism.gatech.EDU (Jim Burns) (03/09/91)

in article <17101@lanl.gov>, mackinnon@fnda20.fnal.gov (MACKINNON, BRYAN) says:
> 
> We need to have two processes map to the same data structure.  The data 
> structure must be statically allocated at compile or link time.  I include
> here some small code segements (both in fortran and c):

Somebody is bound to post or mail a solution for SysV based on shared
memory calls. If you have them, do a 'man' on shmget(2), shmop(2), and
shmctl(2), and try to find a good tutorial on them.

The FORTRAN solution boils down to what kind of support for interfacing to
system calls does your compiler offer? The form of these implementation
details vary wildly from vendor to vendor, and you may only be able to do
it by calling c subroutines, which do the memory sharing, and pass them
your FORTRAN variables.

Some FORTRANs make this extremely easy, tho'. The HP-UX FORTRAN solution
is simply done thru inserting the same compiler directive in each subroutine:

$shared-memory='phs1',XYZ
> 	PROGRAM A
> 	COMMON /XYZ/ MEM

I forget the exact syntax, but basically you name the segment ('phs1' -
the shared memory 'key'), and then list the COMMON blocks you want placed
in it.
-- 
BURNS,JIM (returned student & GT Research Institute staff member)
Georgia Institute of Technology, Georgia Tech Station 30178,
Atlanta Georgia, 30332            | Internet: jb107@prism.gatech.edu
uucp:	  ...!{decvax,hplabs,ncar,purdue,rutgers}!gatech!prism!jb107