On 9/25/2012 5:27 PM, Christoffer Pettersson wrote:
The cin in the thread is only there for demonstration purposes. It was used to 
test the blocking of the cin function. If i write cin in the render thread then 
the program is halted. If i write it in the main thread it is not halted. The 
model code is also just for demonstration. That part of the code works. It's 
essentially just there to recreate the cin problem

Maybe I'm missing your point, but that behavior is exactly what I would expect.

If you try to read from cin in the same thread that you're using for the OSG rendering, it will block waiting for input every time. As far as I know, there's no way for it to not block. The way to get around this is to read commands from cin in a different thread and store the commands in a buffer, and then process the buffered commands in the render thread between frames.

--"J"

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

Reply via email to