<div dir="ltr">It&#39;s just a deadlock. You can open up your debugger and check the thread the application it&#39;s locked on then see who might be holding that lock.</div><div class="gmail_extra"><br><div class="gmail_quote">On 18 April 2016 at 07:36, Mohamed Sakr <span dir="ltr">&lt;<a href="mailto:3dsakr@gmail.com" target="_blank">3dsakr@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi,<br><br>sorry for opening this up again.<br>now I got an OpenGL context.<br><br>what is the call order to update? right now what I do &quot;and freezes everything&quot;:<br>1- try lock scene mutex<br>2- update scene<br>3- unlock<br>4- session reset<br><br>I also tried pause and unpause, but the same result &quot;everything freezes&quot;.<br>any idea?<br><br>cheers,<br>Mohamed Sakr</div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Nov 12, 2015 at 6:31 PM, Mohamed Sakr <span dir="ltr">&lt;<a href="mailto:3dsakr@gmail.com" target="_blank">3dsakr@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">yea, there is no ogl context to work on.., thanks a lot for clarification :)</div><div><div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Nov 12, 2015 at 3:44 PM, Nathan Letwory <span dir="ltr">&lt;<a href="mailto:nathan@mcneel.com" target="_blank">nathan@mcneel.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span>-----BEGIN PGP SIGNED MESSAGE-----<br>
Hash: SHA256<br>
<br>
</span><span>On 12/11/2015 14:58, Mohamed Sakr wrote:<br>
&gt; Hi Nathan,<br>
&gt;<br>
&gt; thanks a lot! :) there are 2 things that I need to understand: 1-<br>
&gt; if I change the scene data &quot;so the scene is always there&quot; ,<br>
&gt; cancel/restart the session performance penalty is ok? (I&#39;m forced<br>
&gt; to background = true)<br>
<br>
</span>There is indeed a performance penalty. I suppose I should make a<br>
screencast tomorrow when at the desk so you can compare what the<br>
performance difference is. It wasn&#39;t that bad, but now that I managed<br>
to get background=false working properly I have to say that it does<br>
feel really nice.<br>
<br>
What is the reason you can&#39;t render using background=false? No access<br>
to a good ogl context? This used to be the case for me too, but once I<br>
managed to get the ogl drawing to work (session-&gt;draw()) it made also<br>
scene updating much more simple.<br>
<br>
&gt; 2-<br>
&gt; <a href="https://github.com/mcneel/RhinoCycles/blob/5a04498c14779533395bbb59b64" rel="noreferrer" target="_blank">https://github.com/mcneel/RhinoCycles/blob/5a04498c14779533395bbb59b64</a><br>
<span>9e33dec4e0f0d/RenderEngines/ViewportRenderEngine.cs#L200-L202<br>
&gt;<br>
&gt;<br>
I kinda don&#39;t understand how do we wait here? assuming you call<br>
&gt; everything from a separate thread, the main thread will handle<br>
&gt; messages and the separate thread will be locked in rendering?<br>
<br>
</span>The Renderer() function gets started in a separate thread indeed.<br>
Based on the status of the ChangeQueue (custom implementation in<br>
ChangeDatabase.cs) will, in this old case of background=true<br>
rendering, cancel the session, which will allow the session rendering<br>
thread to join back into the rendering loop of Renderer().<br>
<br>
As said, it works, and it isn&#39;t all that too bad, but esp. for larger<br>
scenes there will be a noticable pause for the cancel, data upload and<br>
restart.<br>
<br>
/Nathan<br>
<span><br>
&gt;<br>
&gt; cheers, Mohamed Sakr<br>
&gt;<br>
&gt; On Thu, Nov 12, 2015 at 2:31 PM, Nathan Letwory &lt;<a href="mailto:nathan@mcneel.com" target="_blank">nathan@mcneel.com</a><br>
</span><div><div>&gt; &lt;mailto:<a href="mailto:nathan@mcneel.com" target="_blank">nathan@mcneel.com</a>&gt;&gt; wrote:<br>
&gt;<br>
&gt; And hi again,<br>
&gt;<br>
&gt; I wanted to illustrate what I&#39;m doing with some links into the<br>
&gt; source of RhinoCycles. It might help see how it could be done. (And<br>
&gt; I&#39;m assuming here I understood Cycles session management properly<br>
&gt; ;)<br>
&gt;<br>
&gt; Links interspersed in message below.<br>
&gt;<br>
&gt; On 12/11/2015 14:19, Nathan Letwory wrote:<br>
&gt;&gt; Hi,<br>
&gt;<br>
&gt;&gt; On 12/11/2015 13:55, Mohamed Sakr wrote:<br>
&gt;&gt;&gt; Hi,<br>
&gt;<br>
&gt;&gt;&gt; this crashes at some point, any ideas about the general logic<br>
&gt;&gt;&gt; here? note that I&#39;m working with background = true<br>
&gt;<br>
&gt;&gt; With my work on RhinoCycles integration I have found that<br>
&gt;&gt; modifying a running render session with background=true isn&#39;t<br>
&gt;&gt; very easy to do. You&#39;ll have to first cancel the running session,<br>
&gt;&gt; push your changes, then reset and restart.<br>
&gt;<br>
&gt; Not so long ago I was still using background-rendering in<br>
&gt; RhinoCycles. The update and render cycle look like this:<br>
&gt;<br>
&gt; <a href="https://github.com/mcneel/RhinoCycles/blob/5a04498c14779533395bbb59b649e33dec4e0f0d/RenderEngines/ViewportRenderEngine.cs#L150" rel="noreferrer" target="_blank">https://github.com/mcneel/RhinoCycles/blob/5a04498c14779533395bbb59b64<br>
9e33dec4e0f0d/RenderEngines/ViewportRenderEngine.cs#L150</a><br>
&gt;<br>
&gt;  This worked together with a check for changes (and possible<br>
&gt; upload) here:<br>
&gt;<br>
&gt; <a href="https://github.com/mcneel/RhinoCycles/blob/5a04498c14779533395bbb59b649e33dec4e0f0d/RenderEngine.cs#L150" rel="noreferrer" target="_blank">https://github.com/mcneel/RhinoCycles/blob/5a04498c14779533395bbb59b64<br>
9e33dec4e0f0d/RenderEngine.cs#L150</a><br>
&gt;<br>
&gt;  - From CheckFlushQueue() you can see that I cancel the session<br>
&gt; before starting upload to Cycles.<br>
&gt;<br>
&gt;&gt; If you render with background=false you can first pause the<br>
&gt;&gt; session, then lock, update, reset and unpause.<br>
&gt;<br>
&gt; Simple start for the render session in RhinoCycles happens here:<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; <a href="https://github.com/mcneel/RhinoCycles/blob/master/RenderEngines/ViewportRenderEngine.cs#L153" rel="noreferrer" target="_blank">https://github.com/mcneel/RhinoCycles/blob/master/RenderEngines/Viewpo<br>
rtRenderEngine.cs#L153</a><br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; Up until this basic session, scene and their parameters have been<br>
&gt; created and connected.<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; CheckFlushQueue() checks if there are any changes in the<br>
&gt; changequeue, which at this point will be true. Synchronize() will<br>
&gt; pause the session, push the data, reset and unpause.<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; Similarly, while the interactive render session is running I<br>
&gt; periodically check for new changes, which I do in the class<br>
&gt; governing that:<br>
&gt; <a href="https://github.com/mcneel/RhinoCycles/blob/master/Viewport/RenderedVie" rel="noreferrer" target="_blank">https://github.com/mcneel/RhinoCycles/blob/master/Viewport/RenderedVie</a><br>
wport.cs<br>
&gt;<br>
&gt;<br>
, more specifically in the UiUpdate() function here<br>
&gt; <a href="https://github.com/mcneel/RhinoCycles/blob/master/Viewport/RenderedViewport.cs#L125" rel="noreferrer" target="_blank">https://github.com/mcneel/RhinoCycles/blob/master/Viewport/RenderedVie<br>
wport.cs#L125</a><br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; Hopefully this helped.<br>
&gt;<br>
&gt; /Nathan<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;&gt;&gt; cheers, Mohamed Sakr<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
</div></div>&gt; _______________________________________________ Bf-cycles mailing<br>
&gt; list <a href="mailto:Bf-cycles@blender.org" target="_blank">Bf-cycles@blender.org</a> &lt;mailto:<a href="mailto:Bf-cycles@blender.org" target="_blank">Bf-cycles@blender.org</a>&gt;<br>
&gt; <a href="http://lists.blender.org/mailman/listinfo/bf-cycles" rel="noreferrer" target="_blank">http://lists.blender.org/mailman/listinfo/bf-cycles</a><br>
<span>&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; _______________________________________________ Bf-cycles mailing<br>
&gt; list <a href="mailto:Bf-cycles@blender.org" target="_blank">Bf-cycles@blender.org</a><br>
&gt; <a href="http://lists.blender.org/mailman/listinfo/bf-cycles" rel="noreferrer" target="_blank">http://lists.blender.org/mailman/listinfo/bf-cycles</a><br>
&gt;<br>
<br>
</span><span>- --<br>
Nathan Letwory<br>
-----BEGIN PGP SIGNATURE-----<br>
Version: GnuPG v2<br>
<br>
</span>iQEcBAEBCAAGBQJWRJegAAoJEKtfN7KsE0Tt/GUIAI/CcPe+OMShNHuh3snxWCi3<br>
2tLmG1Fq/7vjHUY7GiAqrYcYXlCc6uze2kQZgLFqdMGMqIiPCfRs5wcgwE0ImJWL<br>
UHsKTXKwsBLHCNxeJFswAGniUzIg4w/2KR8mm6iB76DlUANoLO2WIIHXaPXk4hX9<br>
7SmvlUXjF6xGs+P9ZVbXyqTCgGRfYP+DmPOx2RxQMpXBti6Lrepsj4NjciVKnSB3<br>
jhCl7B7wdy/68vwIfQ+lp5V7CxpHtlHcjqS1KLUV9dkRhIaIUStU1Qwd+A0zvc7R<br>
7Yjj2hml1joCCKgd5ZjfzXArZwHspQXHBJdnpG3+XaHEKSD3HiMRhpjs3361fHM=<br>
=9lj0<br>
<div><div>-----END PGP SIGNATURE-----<br>
_______________________________________________<br>
Bf-cycles mailing list<br>
<a href="mailto:Bf-cycles@blender.org" target="_blank">Bf-cycles@blender.org</a><br>
<a href="http://lists.blender.org/mailman/listinfo/bf-cycles" rel="noreferrer" target="_blank">http://lists.blender.org/mailman/listinfo/bf-cycles</a><br>
</div></div></blockquote></div><br></div>
</div></div></blockquote></div><br></div>
</div></div><br>_______________________________________________<br>
Bf-cycles mailing list<br>
<a href="mailto:Bf-cycles@blender.org">Bf-cycles@blender.org</a><br>
<a href="https://lists.blender.org/mailman/listinfo/bf-cycles" rel="noreferrer" target="_blank">https://lists.blender.org/mailman/listinfo/bf-cycles</a><br>
<br></blockquote></div><br></div>