Martin Karlsson wrote:
> Hi Carsten!
> 
> Both logs are at the bottom of this mail.
> I've stopped using the call: 
> getClientThread()->getChangeList()->applyAndClear(); from the external 
> thread.

ok, thanks for the logs.

>  > There is one datastructure in OpenSG that grows without bound, it is a
>  > vector in FieldContainerFactory that maps field container ids to field
>  > containers. But that is usually only a problem when you create huge
>  > numbers of objects. By the way, your program looks as if it leaked a
>  > Barrier, per call to callSync ;)
> 
> I don't understand what you mean when you say that the program leaks a 
> Barrier? The method callSync contains two barrier calls. And the 
> displayfunction also contain two barriercalls (inside the needSync 
> statement). Callsync does not exit until the display function have 
> synchronized it's data. Or have i missed anything? :)

Every call to callSync creates a barrier, which AFAICS is never deleted.

void OpenSGClient::callSync()
{
    std::cout << "callSync called\n";
    syncBarrier = Barrier::get(NULL);
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
This line creates a new barrier. You can change it to
syncBarrier = Barrier::get("OpenSGClient::syncBarrier")
or any other name you like and you'll get the same barrier object each call.
        
    needSync = true;
    syncBarrier->enter(2);
    syncBarrier->enter(2);
}

> About the synchronization to the servers, are this done in separate 
> hidden threads? And how can I make sure that they also get synchronized 
> inside the needSync statement.

It happens in the thread that calls MultiDisplayWindow::render, which is
 called during mgr->redraw(). The MDW just takes the change list of the
current thread and sends it to the servers that were registered with it.
 That is why you need to use
Thread::getCurrentChangeList()->merge(*clientHandle->getChangeList()) in
the display function to get change list entries from the client thread
into the MDW's thread.
The class that actually transmits the change lists is called
RemoteAspect and is in Source/System/Cluster/Base.

> Also I will create a huge amount of objects over time, but these objects 
> also get delete every now and then. Are there a way to clean up old 
> "ids" and clean up this vector? We're currently working on a Interactive 
> Bar (using multitouch, and OpenSG as render, and a tracking algorithm 
> tells the graphic loop either to make/update or destroy blobs).

There is currently no way to reuse id's. If it really becomes a problem
(which I doubt unless you create objects each frame) you would need to
implement some form of reuse scheme for the objects.

> About the debug data. Here is an example where the program crashes. I've 
> just started both programs, and starts to manipulate the surface of our 
> bar. This will generate events that openSG catches and begin to alter he 
> scene.
> This execution of the program crashed right after I started the program 
> and proceeds to manipulate the surface the first time. I've removed all 
> debug text witch contained the startup sequence. The log that follows is 
> right after I've moved the camera a bit. Tell me if you need a whole log 
> and I could email the data to you.
>
> ************* Debug log for server
> DEBUG:  Window 0x0x8250b88 (event 95,ri:25,rf:25): Validating object 24: 
> last reinit:1, last validate:95 last refresh: 0 => up-to-date
> DEBUG:  TextureChunk::activate - 24
> DEBUG:  TexGenChunk::activate
> DEBUG:  Window 0x0x8250b88 (event 95,ri:25,rf:25): Validating object 21: 
> last reinit:1, last validate:95 last refresh: 95 => up-to-date
> DEBUG:  Created:Node 345
[SNIP]
> DEBUG:  Created:Node 362
> DEBUG:  Map: 195 to 329
> DEBUG:  Map: 202 to 345
> WARNING:  Can't find container id:220
> DEBUG:  Map: 220 to 0

I suspect this is the problem. For some reason there is a container
missing on the server side. We need to figure out why it is missing.
Could you please add these calls to ChangeList::dump() in your display
function:

void OpenSGClient::display()
{
    if(needSync==true)
    {
        needSync = false;
        std::cout << "display have recieved a needSync\n";

        syncBarrier->enter(2)
        std::cout << "display is syncing\n";
        std::cerr << "Current Thread CL -- PRE SYNC" << std::endl;
        Thread->getCurrentChangeList()->dump();
        std::cerr << "Client Thread CL -- PRE SYNC" << std::endl;
        clientHandle->getChangeList()->dump();

Thread::getCurrentChangeList()->merge(*clientHandle->getChangeList());
        clientHandle->getChangeList()->applyAndClear();

        std::cerr << "Current Thread CL -- POST SYNC" << std::endl;
        Thread->getCurrentChangeList()->dump();
        std::cerr << "Client Thread CL -- POST SYNC" << std::endl;
        clientHandle->getChangeList()->dump();
        syncBarrier->enter(2);
    }

    std::cerr << "Current Thread CL -- PRE TRANSMIT
    Thread::getCurrentChangeList()->dump();

    mgr->redraw();

    std::cerr << "Current Thread CL -- POST TRANSMIT
    Thread::getCurrentChangeList()->dump();

    OSG::Thread::getCurrentChangeList()->clearAll();
    glClear(GL_COLOR_BUFFER_BIT);
    glutSwapBuffers();
}

Then please recreate the logs.

        Thanks,
                Carsten

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users

Reply via email to