Re: synchronizing on the session object

"Jeroen van Bemmel" <[email protected]>
Newsgroups gmane.comp.voip.nist-sip
Message-ID <005b01c70c1a$d8abf6e0$0601a8c0@BEMBUSTER>
Hagai,

It may work when you set 'gov.nist.javax.sip.REENTRANT_LISTENER' to 'true'. 
If that is false (default) all callbacks to the application will occur 
within the same, single thread each time. Blocking that thread (e.g. by 
using 'synchronize(o)') will indeed result in deadlock

Regards,
Jeroen

PS IMHO this is an omission in the JAIN specs, the threading architecture is 
basically not specified. The property above is NIST RI specific, the 
solution is not portable across vendors
  ----- Original Message ----- 
  From: Hagai Sela (TA)
  To: Hagai Sela (TA) ; [email protected]
  Sent: Sunday, November 19, 2006 2:01 PM
  Subject: RE: [nist-sip] synchronizing on the session object


  oops, I had a mistake. Item 7 should be:

  7. thread 1 tries to send cancel in dialog B. getNewClientTransaction is 
called, and findCancelTransaction finds dialog B's invite transaction. when 
getDialog() is called on that transaction we have a deadlock.




------------------------------------------------------------------------------
  From: [email protected] 
[mailto:[email protected]] On Behalf Of Hagai Sela (TA)
  Sent: Sunday, November 19, 2006 2:39 PM
  To: [email protected]
  Subject: [nist-sip] synchronizing on the session object


  Hi,
  I have a nist-sip based B2BUA. I want to be able to synchronize on a 
session object to serialize request handling on both dialogs on the B2BUA, 
so if I am handling something on one dialog and a request on the other 
dialog comes along it will wait.
  This causes deadlocks, since the stack is synchronized on transaction 
objects before calling my listener. for example:

  1. The stack receives an INVITE on dialog A, and forwards it on dialog B.
  2. CANCEL is received on dialog A in thread 1.
  3. My listener is called, and is synchronized on the session object 
(thread 1)
  4. a negative response is received on dialog B in thread 2.
  5. The stack is synchronized on B's INVITE client transaction in thread 2.
  6. My listener is called again, tries to synchronize on the session 
object, and is blocked (thread 2).
  7. thread 1 tries to send cancel in dialog B. getNewClientTransaction is 
called, and findCancelTransaction finds dialog A's invite transaction. when 
getDialog() is called on that transaction we have a deadlock.

  Should I not synchronize on any of my objects in the stack callbacks?

  Hagai.



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


  _______________________________________________
  nist-sip mailing list
  [email protected]
  http://www-x.antd.nist.gov/mailman/listinfo/nist-sip

_______________________________________________
nist-sip mailing list
[email protected]
http://www-x.antd.nist.gov/mailman/listinfo/nist-sip
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.