2008/12/9 Aleksander Morgado <[EMAIL PROTECTED]>:
> After creating a NTA agent with a thread-safe home, is it ok to assume
> that any other thread can call nta_leg_destroy() without any
> synchronism problem?
>
> What if nta_leg_destroy() is called from a given thread, and meanwhile
> the "main" thread is receiving a new transaction to that same leg?
>
> Also, what if a new leg is created in the NTA (so added to the
> internal list of legs) and meanwhile another thread calls
> nta_leg_destroy() (so removed from the internal list of legs). Are
> those operations on the internal list (or hash table, or whatever it
> is) synchronized in a multi-threaded environment with a thread-safe
> home in the NTA?
>
> In a brief, is making the home of NTA agent thread-safe enough for all
> those situations?

Unfortunately no. The nta functions are thread-safe in the mean that
they do not use any shared global data, the nta objects like nta_leg_t
or nta_agent_t are not thead-safe.

You have to obtain the root (via su_root_obtain()) that is used by nta
in order to access the nta objects in safe manner. (The original
thread used to create the root object must first release it with
su_root_release()).

-- 
Pekka.Pessi mail at nokia.com

------------------------------------------------------------------------------
SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
The future of the web can't happen without you.  Join us at MIX09 to help
pave the way to the Next Web now. Learn more and register at
http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
_______________________________________________
Sofia-sip-devel mailing list
Sofia-sip-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sofia-sip-devel

Reply via email to