[PJSIP 1.1] deadlock on high call volume

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

 



>Nevertheless, you have a valid point that a deadlock may happen when calling pjsua_ calls from a PJSIP callback event.

On Windows the mutex semantics are recursive in nature, so a thread that acquired a mutex can re-acquire it multiple times without entering a deadlock (assuming here that the PJSIP callback is from the same thread that holds the lock). In general I haven't had issues in calling pjsua_* API's from the callbacks on both Windows and Symbian.

Cheers,
Hitesh
  ----- Original Message ----- 
  From: Nguyen Van Minh Danh 
  To: pjsip at lists.pjsip.org 
  Sent: Tuesday, June 16, 2009 9:35 PM
  Subject: Re: [PJSIP 1.1] deadlock on high call volume


  Hi David

  Thanks for the suggestions. I was doing the playing/recording/conference add/remove port inside the on_call_state callback event. After some research, I think the issue I mentioned has got to do with this 

  [pjsip] Infinite loop in jbuf causing deadlock, http://lists.pjsip.org/pipermail/pjsip_lists.pjsip.org/2009-March/006761.html

  There was a bug in jbuf.c (v1.1) which resulted in an infinite loop. The PJSIP release log shows that the issue has been fixed in PJSIP 1.2. So I upgraded to 1.2 (I was using 1.1), did not change my code at all, and the issue doesn't seem to appear anymore.

  Nevertheless, you have a valid point that a deadlock may happen when calling pjsua_ calls from a PJSIP callback event. Previously I observed deadlocks when calling pjsua_call_makecall and pjsua_call_hangup, which could only be resolved by calling these APIs from a separate thread but I did not know it had to do with the callback event.

  As an experiment, I run PJSIP 1.1 with code modified to do the pjsua_ calls from a separate thread (and not in the PJSIP callback function) and the issue also does not appear again.

  Thanks


------------------------------------------------------------------------------


  _______________________________________________
  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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.pjsip.org/pipermail/pjsip_lists.pjsip.org/attachments/20090616/8223bc7f/attachment-0001.html>


[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