[Freeswitch-users] help with mod_conference stability

Anthony Minessale anthony.minessale at gmail.com
Fri May 15 06:20:39 PDT 2009


Unfortunately, no scripting language we have encountered
has ever done proper threading to the point that you could even begin to do
that.

Lua is one of the better ones in a threaded env only because they solved the
problem by making a tiny VM that
can be easily reproduced thousands of times.  You still can't share a lua vm
across threads or it will crash because they
use lots of setjmp longjmp calls to travel between their virtual stack and
the real one.

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
JS instance per call just because of all the garbage collection and thread
safety issues we have encountered.
you have to call a whole bunch of hidden mutexes marked suspend and resume
etc everywhere in the code where you
transition from executing script side code to a blocking FreeSWITCH
function.


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
resources is to not leave the script open while you do something you know
will take a long time "playing a 2 hour file, bridging a call, joining a
conference" because the script resources are allocated and doing nothing
this whole time and they all share a global garbage collector.  if you don't
need to remain in the script just transfer the call to a static extension
and close it.  It's just a suggestion really.



On Thu, May 14, 2009 at 4:56 PM, David Knell <dave at 3c.co.uk> wrote:

> On Thu, 2009-05-14 at 12:31 -0500, Brian West wrote:
> > Its obvious if you look at the size of the JS VM vs the lua VM.. it
> > would clearly scale better not needing megs and megs of ram per call
> > vs about 160kb for lua.
>
> Isn't this a bit of a non sequitur, given that there ought to be just
> one copy of the JS interpreter in RAM which is shared across all of the
> calls/threads which need to use it?
>
> --Dave
>
>
> _______________________________________________
> Freeswitch-users mailing list
> Freeswitch-users at lists.freeswitch.org
> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
> http://www.freeswitch.org
>



-- 
Anthony Minessale II

FreeSWITCH http://www.freeswitch.org/
ClueCon http://www.cluecon.com/

AIM: anthm
MSN:anthony_minessale at hotmail.com <MSN%3Aanthony_minessale at hotmail.com>
GTALK/JABBER/PAYPAL:anthony.minessale at gmail.com<PAYPAL%3Aanthony.minessale at gmail.com>
IRC: irc.freenode.net #freeswitch

FreeSWITCH Developer Conference
sip:888 at conference.freeswitch.org <sip%3A888 at conference.freeswitch.org>
iax:guest at conference.freeswitch.org/888
googletalk:conf+888 at conference.freeswitch.org<googletalk%3Aconf%2B888 at conference.freeswitch.org>
pstn:213-799-1400
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20090515/cb942bf3/attachment-0002.html 


More information about the FreeSWITCH-users mailing list