[comp.unix.wizards] Shared memory and FORTRAN

m5@lynx.uucp (Mike McNally) (02/09/90)

A potential customer of ours is currently using an OS (I don't know
which one) that provides a nifty (in a gross FORTRAN kind of way)
inter-process shared memory facility.  The FORTRAN code declares
"global" COMMON blocks, which (I assume) get tagged by the linker such
that the executable file has magic goomers in it.  The magic goomers
tell the loader that a shared memory segment should be allocated (and
maybe where it should be, since it would be kinda hard for the loader
to relocate the whole mess on the fly).

Anyhow, does anybody know of a mechanism (similar to the one above or
otherwise) that would allow a FOTRAN program easy access to shared
memory?  I don't do FORTRAN on a regular basis, so I'm pretty
ignorant; maybe the global COMMON mechanism is COMMONplace.  

-- 
Mike McNally                                    Lynx Real-Time Systems
uucp: {voder,athsys}!lynx!m5                    phone: 408 370 2233

            Where equal mind and contest equal, go.

notes@hpcmfs.CORP.HP.COM (Notesfiles owner ) (02/10/90)

/ hpcmfs:comp.unix.wizards / m5@lynx.uucp (Mike McNally) /  8:44 am  Feb  8, 1990 /
>A potential customer of ours is currently using an OS (I don't know
>which one) that provides a nifty (in a gross FORTRAN kind of way)
>inter-process shared memory facility.  The FORTRAN code declares
>"global" COMMON blocks, which (I assume) get tagged by the linker such
>that the executable file has magic goomers in it.  The magic goomers
>tell the loader that a shared memory segment should be allocated (and
>maybe where it should be, since it would be kinda hard for the loader
>to relocate the whole mess on the fly).
>
>Anyhow, does anybody know of a mechanism (similar to the one above or
>otherwise) that would allow a FOTRAN program easy access to shared
>memory?  I don't do FORTRAN on a regular basis, so I'm pretty
>ignorant; maybe the global COMMON mechanism is COMMONplace.  

	Fortran COMMON is the equivalent of extern in C, import & export 
in Pascal (I think that they are the keywords in Pascal).

	Speaking for HP's RTE (Real Time Executive) only, shared memory
is allocated a specific block of 'hardware memory'. The allocation -how much
memory to reserve for shared memory and nothing else- is done at system
generation time (something like kernel reconfiguration). 
All shared memory segments point to that hardware -absolute- address.
The symbol table is built accordingly.

	To use it, all programs must have in their source exactly the same
COMMON statement : the sequence of how variables are declared in that block,
implies its relative location in shared memory.