Unfortunately, no scripting language we have encountered <br>has ever done proper threading to the point that you could even begin to do that.<br><br>Lua is one of the better ones in a threaded env only because they solved the problem by making a tiny VM that <br>
can be easily reproduced thousands of times.  You still can&#39;t share a lua vm across threads or it will crash because they<br>use lots of setjmp longjmp calls to travel between their virtual stack and the real one.<br>
<br>As a matter of fact, spidermonkey has code that tries to be threadsafe (but you have to enable it, --with-threadsafe makes me nervous =]) and it shares as much as it can already and we have debated changing it so it creates a whole<br>
JS instance per call just because of all the garbage collection and thread safety issues we have encountered.<br>you have to call a whole bunch of hidden mutexes marked suspend and resume etc everywhere in the code where you<br>
transition from executing script side code to a blocking FreeSWITCH function.<br><br><br>Really, the only point in my original comment was that if you want to scale up something that uses scripting the first way to save<br>
resources is to not leave the script open while you do something you know will take a long time &quot;playing a 2 hour file, bridging a call, joining a conference&quot; because the script resources are allocated and doing nothing this whole time and they all share a global garbage collector.  if you don&#39;t need to remain in the script just transfer the call to a static extension and close it.  It&#39;s just a suggestion really.<br>
<br><br><br><div class="gmail_quote">On Thu, May 14, 2009 at 4:56 PM, David Knell <span dir="ltr">&lt;<a href="mailto:dave@3c.co.uk">dave@3c.co.uk</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="im">On Thu, 2009-05-14 at 12:31 -0500, Brian West wrote:<br>
&gt; Its obvious if you look at the size of the JS VM vs the lua VM.. it<br>
&gt; would clearly scale better not needing megs and megs of ram per call<br>
&gt; vs about 160kb for lua.<br>
<br>
</div>Isn&#39;t this a bit of a non sequitur, given that there ought to be just<br>
one copy of the JS interpreter in RAM which is shared across all of the<br>
calls/threads which need to use it?<br>
<br>
--Dave<br>
<div><div></div><div class="h5"><br>
<br>
_______________________________________________<br>
Freeswitch-users mailing list<br>
<a href="mailto:Freeswitch-users@lists.freeswitch.org">Freeswitch-users@lists.freeswitch.org</a><br>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>Anthony Minessale II<br><br>FreeSWITCH <a href="http://www.freeswitch.org/">http://www.freeswitch.org/</a><br>ClueCon <a href="http://www.cluecon.com/">http://www.cluecon.com/</a><br>
<br>AIM: anthm<br><a href="mailto:MSN%3Aanthony_minessale@hotmail.com">MSN:anthony_minessale@hotmail.com</a><br>GTALK/JABBER/<a href="mailto:PAYPAL%3Aanthony.minessale@gmail.com">PAYPAL:anthony.minessale@gmail.com</a><br>
IRC: <a href="http://irc.freenode.net">irc.freenode.net</a> #freeswitch<br><br>FreeSWITCH Developer Conference<br><a href="mailto:sip%3A888@conference.freeswitch.org">sip:888@conference.freeswitch.org</a><br><a href="http://iax:guest@conference.freeswitch.org/888">iax:guest@conference.freeswitch.org/888</a><br>
<a href="mailto:googletalk%3Aconf%2B888@conference.freeswitch.org">googletalk:conf+888@conference.freeswitch.org</a><br>pstn:213-799-1400<br>