Re: Shared memory???

New Message Reply Date view Thread view Subject view Author view

Robert Grzeszczuk (rg)
Wed, 17 Feb 1999 17:44:22 -0800


Thomas,

Take any MPU-related info with a grain of salt, as my knowledge of MPU is
rather cursory. Please, do contact Patrick Bouchaud (galaad@neu.sgi.com)
and/or Jean-Jacques Pittet (pittet@neu.sgi.com) for more details.

First, try avoiding forking as much as you can. There are just too many memory
management issues involved here. If you do have to resort to forks, you can
still make your life a little easier if you replicate data for each process.
 That is, maintain a separate copy of the transient geometry (aPolygonSetArray)
and re-polygonize the whole volume in each process. This may add some extra
host processing, but can be minimized by caching (see voglCache.cxx) and
asynchronous processing.

Now, if you really insist on sharing your data among the processes you will
have to override the global scope new and delete operators to used shared
arenas:

void *operator new(size_t newsize);
void *operator new[](size_t newsize);
void operator delete(void *ptr );
void operator delete[](void *ptr);

For example:

void *
operator new(size_t newsize) {

  if( myGlobalFlag )
    return amalloc(newsize,myArena)
  else
    return malloc(newsize);
}

Make sure to delete using a matching method.

Hope that helps.

-rg

On Feb 16, 10:56pm, Thomas Sangild Sorensen wrote:
> Subject: Shared memory???
> Hi!
>
> I just started working on a 2-pipe - 6 procs Onyx2,
> and I would like to have Volumizer output to both pipes.
>
> I fork off processes to render each pipe separately (I use MPU).
> Each process can only read/write to its own part of the memory.
>
> Before I start, I would like to hear any advice you could give,
> about how to allocate Volumizer data into shared memory.
>
> The way I'm planning to organise the processes, would be to have one
> process fill the array 'voIndexedFaceSet***' (using polygonize),
> and have this data in shared memory.
> Here, it would be available for all processes to render.
>
> If I make a call like
>
> aPolygonSetArray[j1][j2] =
> new voIndexedFaceSet(allVertexData, boundFaceCount(tetraCount));
>
> only the process making this call will have access to the part
> of memory where the voIndexedFaceSet is allocated.
>
> How can I allocate in shared memory instead?
> In general, how do I allocate any Volumizer datatype in shared memory?
> Will I have to skip 'new' and use 'usmalloc' somehow?
>
> Any hint would be appreciated.
>
>
> Thanks,
> Thomas
>
>
> --------------------------------
> Thomas Sangild Sorensen,
> CIT, Aarhus University, Denmark.
>
> sangild@daimi.au.dk.
> --------------------------------
>-- End of excerpt from Thomas Sangild Sorensen


New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2.0b2 on Mon Nov 01 1999 - 11:59:09 PST