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

Robert Osfield robert.osfield at gmail.com
Mon Nov 9 01:38:29 PST 2015


Hi Kouichi,

On 8 November 2015 at 17:55, Kouichi Yoshizawa <
kouichi.yoshizawa23 at gmail.com> wrote:

> 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?
>

Personally I'd keep things simply.  Reading/create/optimize the actual
scene graph data in a background thread and then use the
IncrementalCompileOperation to download objects from the new scene graph
bit by bit so your application doesn't break frame.

Potentially you could try compile context but having experimented with it
in the past it can work with some platforms and not others, I wouldn’t
recommend it.

As a general rule, implement the actual functionality you need in a simple
and straight forward way and if it performs how you need it your job is
down, use the free time to go for a walk, spend time with family and
friends etc. If performance isn't sufficient benchmark it, find out where
the bottlenecks are, and only then if you really need to start looking for
more complex solutions that might solve your problems.

Robert
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20151109/13356ee6/attachment-0002.htm>


More information about the osg-users mailing list