[pjsip] pjsua_config::thread_cnt - handling events
bennylp at pjsip.org
Wed Nov 21 10:05:33 EST 2007
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.
tloginbr-pjsip at yahoo.com.br wrote:
> 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
> 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,
> Abra sua conta no Yahoo! Mail, o único sem limite de espaço para armazenamento!
> Visit our blog: http://blog.pjsip.org
> pjsip mailing list
> pjsip at lists.pjsip.org
More information about the pjsip