[osg-users] Running viewer loop and physic calculations in different threads

2009-05-22 Thread Alfonso Callejo Goena
Hello everyone: I'm developing a OSG-based graphic engine for a real time mechanical simulator. I would like that the physics and the graphic display would run in separate threads so that they could work independently without bothering each other. The communication between them is a kind of buffer

Re: [osg-users] Running viewer loop and physic calculations in different threads

2009-05-22 Thread Cory Riddell
Hi Alfonso, I'm doing something similar to what you are doing. My viewer is running in it's own thread. I have a shared object that I use to communicate between the threads. If you are looking for sample code, I can try to distill what I have to something relatively simple. I'm using the boos

Re: [osg-users] Running viewer loop and physic calculations in different threads

2009-05-22 Thread Alfonso Callejo Goena
Cory Riddell writes: > > > Hi Alfonso, > I'm doing something similar to what you are doing. My viewer is running > in it's own thread. I have a shared object that I use to communicate > between the threads. If you are looking for sample code, I can try to > distill what I have to something rela

Re: [osg-users] Running viewer loop and physic calculations in different threads

2009-05-22 Thread Cory Riddell
Alfonso, I've distilled my code down. I hope I haven't cut out too much. The most complicated part for me was getting the halting sequence correct. I tell the viewer to stop drawing and then have to wait until the viewer thread is finished and notifies me that it is complete. I have a view c

Re: [osg-users] Running viewer loop and physic calculations in different threads

2009-05-27 Thread Alfonso Callejo Goena
Cory, Paul and all, Thank you for your answers. I have finally solved it by using Intel's TBB, among which there are some functions to launch threads. Best regards, Alfonso 2009/5/22 Alfonso Callejo Goena > Hello everyone: > > I'm developing a OSG-based graphic engine for a real time mechanica