[osg-users] Questions about shared compile contexts and thread safety

Kouichi Yoshizawa kouichi.yoshizawa23 at gmail.com
Sun Nov 8 09:55:01 PST 2015


robertosfield wrote:
> In general I would discourage use of compile contexts except for very narrow usage models.  The main issue comes down to shadred contexts having the potential for conflicts when reading/writing to shared GL objects.  The OSG doesn't have mutexes built into access of GL objects so can only do shared context/compile context if no GL objects will be accessed by the two contexts concurrently.  Adding such mutexes would add a huge burden on all OSG applications.

Robert, thanks for the very quick reply!
I want to use the compile context thread only for creating and compiling new geometry and textures while the draw thread is rendering the old objects. Is it then possibe to avoid conflicts with the GL objects? I have already identified that flushing deleted GL objects must in that case be done in the compile thread as well, but are there other such issues to be aware of? Is the IncrementalCompileOperation safe to use as-is with a shared compile context?

Thanks,
Kouchi

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=65580#65580








More information about the osg-users mailing list