Re: Multi-process problem

New Message Reply Date view Thread view Subject view Author view

Allan Schaffer (aschaffe)
Wed, 15 Jun 1994 17:27:34 -0700


On Jun 15, 11:19am, Payton White wrote:
>
> This should be a simple problem, but it has been causing us much
> trouble. We have been developing a scaled down application on some
> single cpu machines with Performer 1.2 with no problems. When we
> recompile and run it on a RE (OS 5.2) we get plenty of crashes. As
> per the manual, this means we are probably doing something wrong
> with (not) allocating things in our shared memory structure. We have
> _everything_ (scene, pipe, channel, env, light model material, etc)
> in our shared structure and we malloc for it before pfConfig when the
> processes split.

Just for a sanity check -- be sure that you're using pfMalloc (and
not malloc). Also that the pfMalloc for your shared struct is
between pfInit() and pfConfig(), ie..

    /* Initialize Performer */
    pfInit();

    /* Use default multiprocessing mode based on number of processors. */
    pfMultiprocess (PFMP_DEFAULT);

    /* Malloc storage in shared memory region for shared data */
    shared = (SharedData *) pfMalloc(sizeof(SharedData),pfGetSharedArena());

    /* Configure multiprocessing mode and start parallel processes */
    pfConfig();

> Through debugging we have found it crashes on
> pfShadeModel, pfApplyLModel, pfApplyMtl, pfApplyGState.

It's likely then that you're calling these routines from the APP
process. They are libpr routines that make GL calls, so they can
only be called from within the DRAW.

On an MP machine, the APP, CULL, and DRAW stages can each be
different processes. Only the DRAW process has access to the
rendering pipeline, so you can only make those calls in the pipe
initialization callback, channel draw callback, or node draw
callbacks.

When Performer runs on a 1-CPU machine this doesn't matter so much,
since the APP, CULL, and DRAW are all part of the same process.
That's probably why you didn't see the problem before.

And as always, take a look in /usr/src/Performer/src/pguide/libpf/progs
for some samples.

Allan

-- 
Allan Schaffer
Silicon Graphics
aschaffe++at++sgi.com

New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2.0b2 on Mon Aug 10 1998 - 17:50:20 PDT

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