<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:times new roman, new york, times, serif;font-size:14pt"><font size="3">my 2-cent probably worthless thought: We would fork a process so that if it crashed or got deadocked, it would not bring the core server down with it or lock it. We could control CPU allocation and see it in the process list as a separate element. If that principle applies to tasks running under a browser, I would stay with the forking and have it essentially run as a subprocess, separate from the other tabs and processes and applets that are also running concurrently. I just had this yesterday in IE where an ActiveX control in one tab crashed the whole browser. Conversely, if it is a fork, it might not be nearly as affected when <span style="font-style: italic;">other </span>processes/applets/plugins fail. <br></font><div><font size="3">&nbsp;</font></div><font
 size="3">----------------<br>Sent by Roger Wickes for intended recipient. If you are not the intended recipient, please delete this message and contact Mr. Wickes immediately.<br><br></font><div><font size="3">Atlantica Investments, Inc.<br>PO Box 680310, Marietta, GA 30068 USA</font><div><br></div><div style="font-family: times new roman,new york,times,serif; font-size: 14pt;"><br><div style="font-family: times new roman,new york,times,serif; font-size: 12pt;">----- Original Message ----<br>From: Marcelo Coraça de Freitas &lt;mfreitas@ydeasolutions.com.br&gt;<br>To: bf-committers@blender.org<br>Sent: Thursday, September 25, 2008 4:51:05 PM<br>Subject: [Bf-committers] Blender Web Plugin ::  Thread vs Fork<br><br>



  
  

Hello all,<br>
<br>
&nbsp;&nbsp;&nbsp; Something occurred to me right about now.<br>
<br>
&nbsp;&nbsp;&nbsp; The original problem with the Firefox Blender Web Plug-in is that there was a dirty lock for rendering with OpenGl in the plugin Window. That's solved with xembed. What just occurred to be is that, with xembed, there is no real need for forking the process.<br>
<br>
&nbsp;&nbsp;&nbsp; Even though forking the process gives us more stability, as if blender crashes the browser keeps going, it's a lot slower than threads (simply because for each plugin instance there will be needed to initialize the entire game engine - load the engine code into the memory and running it's main - and harder to script - even using dbus.<br>
<br>
&nbsp;&nbsp;&nbsp; If we work with threads that's solved. And we also gain something that's quite important: the ActiveX plugin work with threads and there is no locking in the opengl context (there is a data locking for something I didn't quite understand yet, but I've seen some examples over the web where people render OpenGL into the control's window without locking anything!<br>
<br>
&nbsp;&nbsp;&nbsp; We could have then a common code in both web plugins. But there is also another problem. The game player uses some global variables (I know only about one, the G variable - which has gave me some headaches in the past plugin code), so refactoring is needed in order to implement this approach. But, once it's achieved we'd have a code that's easier to maintain - as the plugin and the stand alone player would be different applications, sharing a great part of the code.<br>
<br>
&nbsp;&nbsp;&nbsp; Those are only initial thoughts. I might come up with some testing code so I can make sure it'll work as expected. <img alt=":)" align="middle" border="0"><br>
<br>
<br>
Regards,<br>
<br>
<table cellpadding="0" cellspacing="0" width="100%">
<tbody><tr>
<td>
<img align="bottom" border="0"><br>
<br>
<font size="2"><font color="#0090ff">Marcelo Coraça de Freitas </font></font><br>
<font size="2"><font color="#0090ff">Gerente de TI </font></font><br>
<br>
<font size="2"><font color="#0090ff">Ydea Desenvolvimento de Software LTDA. </font></font><br>
<font size="2"><font color="#0090ff">Av. Adolfo Pinheiro, 2338 - Alto da Boa Vista </font></font><br>
<font size="2"><font color="#0090ff">CEP.:04734-004 - São Paulo - SP </font></font><br>
<font size="2"><font color="#0090ff">Tel.: 55-11-5523-0333</font></font><br>
<font size="2"><font color="#0090ff">Tel.: 55-11-8685-1429</font></font>
</td>
</tr>
</tbody></table>
</div></div></div></div><br>

      </body></html>