Re: swap file number

From: Henrik Nordstrom <hno@dont-contact.us>
Date: Fri, 28 Mar 2003 10:37:11 +0100

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
Received on Fri Mar 28 2003 - 03:11:32 MST

This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 16:19:35 MST