From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.5-pre1 (2020-06-20) on ip-172-31-74-118.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-1.9 required=3.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.5-pre1 Date: 28 Sep 92 15:53:39 GMT From: agate!linus!linus.mitre.org!giddings.mitre.org!user@ucbvax.Berkeley.EDU (Victor Giddings) Subject: Re: Using Global Variables Message-ID: List-Id: In article <1992Sep22.201420.25962@swlvx2.msd.ray.com>, lms@swl.msd.ray.com (LEE MARDEN) wrote: > > > At the risk of being flamed for continuing to beat a dead horse, could some > summarize the methods available (good and bad) for using shared memory. I > just started to monitor comp.lang.ada and have a specific problem I'm trying > to solve. Here goes: I have a 4D/240 Power series Silicon Graphics computer > running Irix 4.0.1 (Unix) and the Verdix Ada compiler (on order). The comput er > has 4 processors. The plan is to reuse code as much as possible so I'm > stuck with one processor running C, another Fortran and the other two Ada. > Each processor needs to communicate with the others. I'm not sure on the > amount of data, but my first guess would be tons(>1k variables). My initial > investigate has only lead me to the conclusion that I would have to write > some Ada wrappers around the C routines (shmctl, shmop, shmget) to control > a shared memory chunk, We actually experimented with this with some success (although I still think it was a bad idea). We did, however, have unexplained intermittent crashes. We speculated that the shmat (using shmaddr:= 0) was returning an address that the run-time system was re-using for a dynamic allocation. Any SGI and/or Verdix gurus wish to comment? > and that all I would get is a pointer to the data > space. That would make data access very clumsy. The indirection can be accomplished using one qualification, e.g. Global_Pool.Data_Element. Doesn't strike me as any more clumsy than trying to maintain the data space in the first place. :-) > I've heard of some Pragmas > on other systems that allow you to specify that an entire package of variable s > be shared, and utilities to perform the maintance thereof. I hope that's > enough info for someone to respond. If not, let me know and I'll elaborate > (no pun intended). > > AdvThanksance, Lee Marden > > -- > AdvThanksance, > > Lee S. Marden, lms@swlray.msd.ray.com > Raytheon Company, Missile Systems Division, Tewksbury, MA 01876