RE: Shared memory problem

New Message Reply Date view Thread view Subject view Author view

From: PEPPER Craig (craig.pepper++at++tenix.com)
Date: 04/06/2000 16:06:32


When multiprocessing, you need to allocate the class/structure that will
contain pointers to pfThings before pfConfig so all processes can see it.

The simple solution is to derive your container class from pfObject or
pfMemory, and dynamically allocate an instance before pfConfig, eg:
container = new ContainerClass;

The derivation from pfMemory will get your container allocated in shared
memory, where it can be seen by all processes. You can then go ahead after
pfConfig and allocate your pfGeode, etc, and store the pointers in your
container class.

Hope this helps.

Craig Pepper
Engineering - Simulation Systems
Systems Division, Tenix Defence Systems, Australia

> -----Original Message-----
> From: Paul F Brewster [mailto:p.f.brewster++at++larc.nasa.gov]
> Sent: Friday, 7 April 2000 07:18
> To: info-performer++at++sgi.com
> Subject: Shared memory problem
>
>
> I'm still fairly new to Performer, so this may be a dumb/unanswerable
> question, but I can't figure it out.
>
> I wrote a simple program in C++ Performer that works fine. It
> just creates
> a pfGeode, pfGeoSet, pfGeoState, pfTexture, pfTexEnv, and a
> pfMatrix that
> is used as the texture matrix for the pfTexture. This is all
> done in the
> main part of the program after pfConfig and before the event
> loop. This
> part works great.
>
> I then wanted to take all these variable and put a class
> wrapper around
> them to isolate them, and modularize my code. The class is
> just a simple
> class with each of these variables as members. The variables are
> initialized just like they were before. Unfortunatly, when I run this
> program I get a blank screen. Occasionally it dies saying
> that a certain
> process died. When I switch to PFMP_APPCULLDRAW, the program works
> perfectly. Obviously this makes me think there is a problem
> with shared
> memory or something, but I can't find that problem anywhere.
> My wrapper
> class does not have to be in shared memory right? Are there
> any gotchas,
> or things I am not doing here? Any help is appreciated...
>
> Paul
>
>
> --------------------------------------------------------------
> ---------
> List Archives, FAQ, FTP: http://www.sgi.com/software/performer/
> Submissions: info-performer++at++sgi.com
> Admin. requests: info-performer-request++at++sgi.com
>


New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2b29 : Thu Apr 06 2000 - 16:13:41 PDT

This message has been cleansed for anti-spam protection. Replace '++at++' in any mail addresses with the '@' symbol.