Saturday, March 17, 2012, 10:33:18 PM, you wrote: > On Thu, Mar 15, 2012 at 11:01 AM, Alan M. Carroll > <a...@network-geographics.com>wrote: > Thursday, March 15, 2012, 9:26:33 AM, you wrote: >> [The lock] is only de-allocated after the close() by which time all >> references to that NetVC should have been dropped by the client. > We must be having some fundamental communication issue. The way I was > thinking was: > VConnection *temp_vc = m_net_vc; > *m_net_vc = NULL; > temp_vc->do_io_close();
I will try to be more explicit. Consider my timeline once again and the callsite in thread A where do_io_close is called. Assume that thread B is not attempting to access the transaction (there is no contention for the netVC or the transaction lock). At that point - 1) What ATS data structure chain can be used to detect that there exists an instance of HttpServerSession in thread B with member server_vc pointing at this netVC, so that thread A knows a reference needs to be dropped, or it should wait for thread B to drop the reference? Presuming the intent is to do as you describe, drop all references - 2) What ATS data structure chain can be used to access that HttpServerSession::server_vc so that all references can be dropped? 3) What lock should be acquired to prevent simultaneous access to the HttpServerSession by thread A and thread B when thread A drops the reference in HttpServerSession::server_vc? 3A) If this is the transaction lock, how is the circularity avoided where to access server_vc safely you need to acquire the lock, and to acquire the lock you need to access server_vc? 4) What mechanism (present or future) exists to enable thread B to notice that HttpServerSession::server_vc has been modified to drop the reference?