On 9/25/2012 5:01 PM, Christoffer Pettersson wrote:
Hi Jason,

That is pretty much what I'm doing, just the other way around. The main thread 
is responsible for handling standard inputs, while the second thread is 
responsible for handling the renderer.

I didn't see the code you posted earlier (just looked it up on the forum).

I'm a bit confused as to why you're reading from cin in both threads. That is definitely going to cause a problem. You should only be reading from cin in the main thread in your case. I'd expect the viewer thread to be hanging up on that cin call in the run() function on every frame.

Another potential issue I saw is that you're not protecting your _nodes vector at all. You could theoretically be trying to add a model to it in the main thread at the same time as you're pulling models off of it in the renderer thread.

--"J"

_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to