<div dir="ltr"><div><div>Hi Kouichi,<br><br></div>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.<br><br></div>Robert.<br></div><div class="gmail_extra"><br><div class="gmail_quote">On 7 November 2015 at 23:29, Kouichi Yoshizawa <span dir="ltr"><<a href="mailto:kouichi.yoshizawa23@gmail.com" target="_blank">kouichi.yoshizawa23@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello,<br>
<br>
I would like to learn the status of shared compile context threads in OpenSceneGraph, as I would like to make use of them for performance reasons. My platform is Linux with Nvidia Quadro GPUs that should have good support for shared contexts for GPU transfers.<br>
<br>
In 2010 Robert Osfield seems to suggest that shared compile contexts are indeed supported by OSG, although GPU hardware/driver support might be lacking:<br>
<br>
<br>
> I implemented them [ie shared compile contexts] under Linux with NVidia drivers and they worked as expected, but with other drivers and other OS's reports back from the community haven't been so positive, so it looks like it's a feature that driver developers don't put much effort in to make sure it's solid.<br>
<br>
<br>
However, in 2014 he seems to be discouraging their use, maybe due to thread safety issues in OSG, or am I reading this wrong?<br>
<br>
<br>
> The OSG's is written to handling multi-theading of shared contexts as<br>
> handling this special case would require us to add lots of mutex locks<br>
> to all OpenGL code that is setting or using OpenGL objects.<br>
><br>
> It's better to avoid shared contexts.<br>
><br>
<br>
<br>
Inspecting the source code, of particular concern to me is the creation/deletion of GL objects. It appears that the GL object orphan list is accessed without mutual exclusion, from the flush functions as well as the orphan reuse functions during object creation. Therefore these two operations must then never be performed in different threads, but if they are only called from the same thread (the compile context thread in my case) is thread safety then guaranteed? I would be very grateful for clarifications regarding this.<br>
<br>
Thank you!<br>
<br>
Cheers,<br>
Kouichi[/quote]<br>
<br>
------------------<br>
Read this topic online here:<br>
<a href="http://forum.openscenegraph.org/viewtopic.php?p=65576#65576" rel="noreferrer" target="_blank">http://forum.openscenegraph.org/viewtopic.php?p=65576#65576</a><br>
<br>
<br>
<br>
<br>
<br>
_______________________________________________<br>
osg-users mailing list<br>
<a href="mailto:osg-users@lists.openscenegraph.org">osg-users@lists.openscenegraph.org</a><br>
<a href="http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org" rel="noreferrer" target="_blank">http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org</a><br>
</blockquote></div><br></div>