Common areas/common data/data sharing 
Author Message
 Common areas/common data/data sharing

I'm not sure that this is the right place to post this, but...
I want to get the effect of fortran group common blocks in C.  In other words,
I want to be able to have 3 or 4 programs all sharing the same block of data,
some reading from it and some writing to it, without storing it all to a file
(file access is rather slow).  In FORTRAN, I would create a common block and
INSTALL it using the VAX Installer.  when I try to INSTALL a variable list
(linked shared) as a shareable image, it fails with:  cannot create writable
section to read only file.  Any ideas from anyone out there?

An example:
        I want some programs to share some data...say the variables i,j,k.
        So i create a program:
        /* Common block */
        int i,j,k;

        compile it, and link it /SHARED.  In each program I want to use it, I
        declare the variables as extern and link the program with the block.
        This allows the programs to share the variables.

        Now, to get them to share the DATA, I INSTALL it.  This fails as
        described above.

Thanks in advance for any suggestions you might have.



Big Bear City, CA|                           |than to drive a Buick through the
            92314|!*** G O   N I N E R S ***!|hole in a doughnut.



Mon, 31 May 1993 09:29:14 GMT  
 Common areas/common data/data sharing

Quote:

>I want to get the effect of FORTRAN group common blocks in C.  In other words,
>I want to be able to have 3 or 4 programs all sharing the same block of data,
>some reading from it and some writing to it, without storing it all to a file
>(file access is rather slow).  In FORTRAN, I would create a common block and
>INSTALL it using the VAX Installer...

You would be better off asking this question in one of the VMS groups; I
assume it's VMS Fortran you're talking about.  The answer is very
system-specific, because such a facility is not a standard part of C
(or of Fortran, for that matter).
--
"The average pointer, statistically,    |Henry Spencer at U of Toronto Zoology



Mon, 31 May 1993 12:50:55 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Code for common data structures/algorithms?

2. COM and common data per instance

3. Need a good C library of common data structures

4. converting BSTR data type to common string type!

5. SHARED COMMON MEMORY

6. Shared Commons and C

7. DLL with shared data/class not sharing...

8. placing constatnt data in code area

9. 3 parts of data area in C

10. displaying integer data types in the client area of a window

11. Need To Share Data With Different Forms

12. sharing data types

 

 
Powered by phpBB® Forum Software