Chengdu Huang wrote: > > > Squid knows if there is clients currently reading the (possibly old) > > object, and it won't be deleted in such case until those clients are > > done. > > Is that tracked by entry->mem_obj->clients?
No, by storeLock/UnlockObject. > I am still not comfortable with the structure that each URL maps to a > StoreEntry and a MemObject while multiple store_client's share the > same StoreEntry and MemObject. The MemObject keeps information about the object as such, not the client. The MemObject structure keeps the information which is not needed to keep in memory while there is no client accessing the object. The store clients accessing the object is also attached to the MemObject, allowing them to be notified when data has become available etc. > Is it possible that there's race condition? Not likely. This code is explicitly designed for having multiple clients at the same time. > The code heavily relies on various flags of the StoreEntry > and MemObject and things like inmem_hi/inmem_lo. The flags is again related to the object as such, not the clients. The inmem_hi/lo indicates which area of the object is shadowed in memory. If a client does not find what it needs here it is read from the disk object. Regards Henrik
