pjsua_config::thread_cnt - handling events

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



thanks for the reply. Do you think it would be
possible for me to create some threads to handle this
events in my application instead of using pjsua's
thread? I'm thinking of creating some threads at
startup that would stay sleeping until I send one
event for it to do the database code or other things
that could take long. I just don't know how to send
this events to the thread... but I think I'll find
some way. I just want to know if you think its
possible or is there any problem with the idea.

thanks a lot,

Thiago
> Hi Thiago,
> 
> I'm afraid the design of pjsua-lib does not allow
> more than one 
> thread to enter pjsua-lib, hence the behavior that
> you observed.
> A finer granular locking, where locking is done on
> per call and 
> transaction basis, is only available at pjsip API
> level.
> 
> cheers,
>   -benny
> 
> tloginbr-pjsip at yahoo.com.br wrote:
> > Hi,
> > 
> > I'm doing some tests on one application that
> handles
> > several calls every second. The event of incoming
> call
> > takes a little long (around 1 second) because of
> some
> > mysql queries. So if I have too many call in one
> > second, the events build up and are serialized, so
> the
> > last call will wait for a long time before it gets
> > answered. I figured that this happens because the
> > events are handled in the same thread, so I made
> my
> > application print out the thread address with
> > pj_thread_this() to be sure. So I increased the
> value
> > pjsua_config::thread_cnt that was equal to 1. I
> put it
> > equal to 5, so I should have 5 threads handling
> events
> > now (If I am thinking correctly here...). If I
> test
> > the application sending many calls per second and
> > disable the database access (so there is almost no
> > delay any more) the events get handled by
> different
> > threads, but when I put the database access back
> (and
> > the delay), the events get handled only by one
> thread
> > and are all serialized again, so the problem
> > persists...
> > The same problem happens if I change the database
> > access to a simple sleep() of 1 second.
> > 
> > Is there any other configuration that I have to
> do? Or
> > did I get everything wrong and
> > pjsua_config::thread_cnt will not help me in any
> way?
> > 
> > I am using API 0.8.0 downloaded from the site (not
> > svn) running on a linux debian etch (4.0) system.
> > 
> > thanks a lot for all help,
> > 
> > Thiago
> > 
> > 
> >       Abra sua conta no Yahoo! Mail, o ?nico sem
> limite de espa?o para armazenamento!
> > http://br.mail.yahoo.com/
> > 
> > _______________________________________________
> > Visit our blog: http://blog.pjsip.org
> > 
> > pjsip mailing list
> > pjsip at lists.pjsip.org
> >
>
http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org
> 
> 
> -- 
> Benny Prijono
> http://www.pjsip.org
> 
> 
> _______________________________________________
> Visit our blog: http://blog.pjsip.org
> 
> pjsip mailing list
> pjsip at lists.pjsip.org
>
http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org
> 



      Abra sua conta no Yahoo! Mail, o ?nico sem limite de espa?o para armazenamento!
http://br.mail.yahoo.com/



[Index of Archives]     [Asterisk Users]     [Asterisk App Development]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [Linux API]
  Powered by Linux