Re: Puzzled at storeClientListAdd. A bug? :-(

From: Henrik Nordstrom <hno@dont-contact.us>
Date: Mon, 22 Apr 2002 22:21:50 +0200

maer727@sohu.com wrote:

> Look at this statement in storeClientListAdd,
>
> dlinkAdd(sc, &sc->node, &mem->clients);
>
> I think this statement is used to add a storecilent to the mem
> object of the StoreEntry that the storecilent is related to.

Yes.

> I am puzzled at this statement. Only the StoreEntry being accessed
> has the mem object. Suppose when StoreEntry A is being accessed, the
> storeclient S is added to the mem object of it. And the storecilent S is
> waiting for data that it requested to come. Suppose before the requested
> data comes, we turn to manipulate another StoreEntry B and the mem object
> of A becomes NULL.

The user of the store client (the one calling storeClientListAdd) is required
to hold a lock for A. This way A and it's MemObject is guaranteed to stay for
the duration of the store client.

Regards
Henrik
Received on Mon Apr 22 2002 - 14:21:57 MDT

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