multi threading with libpf objects

New Message Reply Date view Thread view Subject view Author view

Dirk Luesebrink (crux++at++artcom.de)
Mon, 6 Jun 1994 12:50:29 +0100 (MDT)


        hi there,
        i'm searching for a way to make it safe to create libpf objects
        from a thread.
        im now running in APP_CULL_DRAW mode. the application process
        make an sproc for a communication thread which takes cmds from
        the outside world. one such command is "load world".
        then in this thread a loader is started which shuold create
        the performer tree which belongs to that world. if this is finished
        the thread terminates. the new tree is then added to the rest
        by adding it to group node. This happens in the application process.
        for most of my testmodels this mechanism works fine most of the time.
        when i make APPCULLDRAW it work in general.
        the problem is, that with more complicated scenes to load, i get
                Performer Warning (13): Attempt to modify deleted object
        but still most of the time it works, but sometimes it dumpes core.
        now i tried the following.

            // main simulation loop
            while (!Shared->exitFlag)
            {
                pfSync();

                viewer->update();
                 
                plexControl.stopAll();
                pfFrame();
                plexControl.contAll();

                updateScene();

            }
         
        there stopAll and contAll will stop (cont) all threads which are started
        from somewhere in the application. the idea is, to have the extra
        threads in perfect sync with the application process.
        when i do that, Performer Warning (13) disapears. so far so good.
        But, then after while of loading, the whole applicatio wil hang. pfFrame
        does not return any more. it looks like one of the threads aquires some
        resources, then gets blocked, pfFrame starts and waits for that
        resource, but will never get it because the holding thread is stopped.
        off course i could stop the application for running completly through
        the thread and continue afterwards, but thats not what i want.

        any help or hint is greatly appriciated.

        dirk Luesebrink


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:19 PDT

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