Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!usc!jarthur!nntp-server.caltech.edu!juliet.caltech.edu!gceych From: gceych@juliet.caltech.edu (Eychaner, Glenn C.) Newsgroups: comp.lang.c Subject: Common areas/common data/data sharing Message-ID: <1990Dec13.014044.9258@nntp-server.caltech.edu> Date: 13 Dec 90 01:29:14 GMT Sender: news@nntp-server.caltech.edu Reply-To: gceych@juliet.caltech.edu Organization: California Institute of Technology Lines: 28 News-Software: VAX/VMS VNEWS 1.3-4x Nntp-Posting-Host: juliet.caltech.edu 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. Glenn Eychaner |Eychaner@SunCub.Caltech.edu|Remember: It is easier to ride a 40386 N Shore Ln |gceych@iago.caltech.edu |camel through the eye of a needle Big Bear City, CA| |than to drive a Buick through the 92314|!*** G O N I N E R S ***!|hole in a doughnut.