<div dir="ltr">It's just a deadlock. You can open up your debugger and check the thread the application it'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"><<a href="mailto:3dsakr@gmail.com" target="_blank">3dsakr@gmail.com</a>></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 "and freezes everything":<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 "everything freezes".<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"><<a href="mailto:3dsakr@gmail.com" target="_blank">3dsakr@gmail.com</a>></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"><<a href="mailto:nathan@mcneel.com" target="_blank">nathan@mcneel.com</a>></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>
> Hi Nathan,<br>
><br>
> thanks a lot! :) there are 2 things that I need to understand: 1-<br>
> if I change the scene data "so the scene is always there" ,<br>
> cancel/restart the session performance penalty is ok? (I'm forced<br>
> 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'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'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->draw()) it made also<br>
scene updating much more simple.<br>
<br>
> 2-<br>
> <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>
><br>
><br>
I kinda don't understand how do we wait here? assuming you call<br>
> everything from a separate thread, the main thread will handle<br>
> 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'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>
><br>
> cheers, Mohamed Sakr<br>
><br>
> On Thu, Nov 12, 2015 at 2:31 PM, Nathan Letwory <<a href="mailto:nathan@mcneel.com" target="_blank">nathan@mcneel.com</a><br>
</span><div><div>> <mailto:<a href="mailto:nathan@mcneel.com" target="_blank">nathan@mcneel.com</a>>> wrote:<br>
><br>
> And hi again,<br>
><br>
> I wanted to illustrate what I'm doing with some links into the<br>
> source of RhinoCycles. It might help see how it could be done. (And<br>
> I'm assuming here I understood Cycles session management properly<br>
> ;)<br>
><br>
> Links interspersed in message below.<br>
><br>
> On 12/11/2015 14:19, Nathan Letwory wrote:<br>
>> Hi,<br>
><br>
>> On 12/11/2015 13:55, Mohamed Sakr wrote:<br>
>>> Hi,<br>
><br>
>>> this crashes at some point, any ideas about the general logic<br>
>>> here? note that I'm working with background = true<br>
><br>
>> With my work on RhinoCycles integration I have found that<br>
>> modifying a running render session with background=true isn't<br>
>> very easy to do. You'll have to first cancel the running session,<br>
>> push your changes, then reset and restart.<br>
><br>
> Not so long ago I was still using background-rendering in<br>
> RhinoCycles. The update and render cycle look like this:<br>
><br>
> <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>
><br>
> This worked together with a check for changes (and possible<br>
> upload) here:<br>
><br>
> <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>
><br>
> - From CheckFlushQueue() you can see that I cancel the session<br>
> before starting upload to Cycles.<br>
><br>
>> If you render with background=false you can first pause the<br>
>> session, then lock, update, reset and unpause.<br>
><br>
> Simple start for the render session in RhinoCycles happens here:<br>
><br>
><br>
><br>
> <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>
><br>
><br>
><br>
><br>
> Up until this basic session, scene and their parameters have been<br>
> created and connected.<br>
><br>
><br>
><br>
> CheckFlushQueue() checks if there are any changes in the<br>
> changequeue, which at this point will be true. Synchronize() will<br>
> pause the session, push the data, reset and unpause.<br>
><br>
><br>
><br>
> Similarly, while the interactive render session is running I<br>
> periodically check for new changes, which I do in the class<br>
> governing that:<br>
> <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>
><br>
><br>
, more specifically in the UiUpdate() function here<br>
> <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>
><br>
><br>
><br>
> Hopefully this helped.<br>
><br>
> /Nathan<br>
><br>
><br>
><br>
><br>
>>> cheers, Mohamed Sakr<br>
><br>
><br>
><br>
><br>
</div></div>> _______________________________________________ Bf-cycles mailing<br>
> list <a href="mailto:Bf-cycles@blender.org" target="_blank">Bf-cycles@blender.org</a> <mailto:<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>
<span>><br>
><br>
><br>
><br>
> _______________________________________________ Bf-cycles mailing<br>
> list <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>
><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>