Re: [Plib-users] How to run loader and render in separate threads?
Brought to you by:
sjbaker
From: Steve B. <sjb...@ai...> - 2003-02-20 23:26:03
|
Brian R Hill wrote: > Does anyone have an example of how to run a loader process (read files, > create ssg objects, merge into scene graph) and rendering process (glut and > ssgcullandraw) in separate threads? That's not very do-able - SSG was never designed to work that way. I believe FlightGear has done something like that - but not in a totally general way. I would recommend assembling a complete sub-graph in the parallel thread and only connecting it into the main scene graph in the main rendering thread. However, SSG objects are not thread-safe so you have to be spectacularly careful not to access things in one thread that are in use in the other. There are other libraries that went overboard to get all this perfect - but they weren't written in a weekend like the first version of SSG and they tend to impose other nasty limitations on your code. ---------------------------- Steve Baker ------------------------- HomeEmail: <sjb...@ai...> WorkEmail: <sj...@li...> HomePage : http://www.sjbaker.org Projects : http://plib.sf.net http://tuxaqfh.sf.net http://tuxkart.sf.net http://prettypoly.sf.net |