Fwd: Re: Re: Re: How can I find detailed comment about Squid src?

From: Henrik Nordstrom <hno@dont-contact.us>
Date: Mon, 8 Apr 2002 15:53:16 +0200

---------- Forwarded Message ----------

Subject: Re: Re: Re: How can I find detailed comment about Squid src?
Date: Mon, 8 Apr 2002 21:17:08 +0800 (CST)
From: "马琳" <maer727@163.com>
To: hno@squid-cache.org

Thanks, Henrik pal!

You have clarified all my doubts about "age". :-)

I think your opinion is very right. The name of the variable is not a
 good one. (Before your explanation, I tried hard to find how to
 assige a life time of an object to the variable.)

Best regards,
George, Ma

> This "age" variable is specific to the heap policy implementation.
> Not used anywhere else.
>
> In the heap policies the heap key symbols the objects "age" in the
> heap. It do not have a point of origin in time, only the propertity
> that the keys can be sorted.
>
> I am not entirely sure on why the name "age" was selected for this
> specific variable and is why I refer to the paper explaining the
> thinking behind the heap based policy implementation. See the
> description of the LFUDA implementation which was the primary
> policy the heap code was written for (page 4). I think the variable
> should be renamed to heap_age for clarity.
>
> "age" in other parts of Squid usually represents the objects age in
> time. For example in src/refresh.c.
>
> Regards
> Henrik
>
> On Monday 08 April 2002 07:32, 马琳 wrote:
> > Thanks again, Henrik pal!
> >
> > Maybe my English explanation is poor, :-). I understand that
> > variable "age" is referring to the top element of a
> > minimum-value-heap. My question is what is the literature of the
> > variable "age". IMHO, I think the "age" of an object means how
> > long it has been cached in mem/disk since it is first fetched. As
> > I have not read the whole source codes, so I am not very sure
> > about it. Maybe my explanation is not very precise.
> >
> > I think you are a very warm-heated pal! And cute, :-)
> >
> > Have a nice day,
> > George, Ma
> >
> > > On Sunday 07 April 2002 08:27, 马琳 wrote:
> > > > Hi, I am using squid 2.4 stable. When I am reading the source
> > > > codes, I always run in trouble. Because I do not know the
> > > > exact meaning of thre variables of structures.
> > >
> > > Welcome in the club ;-)
> > >
> > > > For example, in file store_heap_replacement.c, line 108
> > > > heap_key
> > > > HeapKeyGen_StoreEntry_GDSF(void *entry, double age)
> > > > {
> > > > StoreEntry *e = entry;
> > > > heap_key key;
> > > > double size = e->swap_file_sz ? (double) e->swap_file_sz
> > > > : 1.0; double tie = (e->lastref > 1) ? (1.0 / e->lastref) :
> > > > 1.0; key = age + ((double) e->refcount / size) - tie;
> > > > debug(81, 3) ("HeapKeyGen_StoreEntry_GDSF: %s size=%f
> > > > refcnt=%ld lastref=%ld age=%f tie=%f -> %f\n",
> > > > storeKeyText(e->hash.key), size, e->refcount, e->lastref,
> > > > age, tie, key); if (e->mem_obj && e->mem_obj->url)
> > > > debug(81, 3) ("HeapKeyGen_StoreEntry_GDSF: url=%s\n",
> > > > e->mem_obj->url);
> > > > return key;
> > > > }
> > > >
> > > > What is the exact meaning of "age"? Can anyone give me a
> > > > brief explanation?
> > >
> > > In this specific case, age is the currently smallest key in the
> > > heap I think. Perhaps more information is in the paper
> > > explaining the heap policies. See lib/heap.c and
> > > src/repl/heap/store_repl_heap.c for the source relating to this
> > > specific "age".
> > >
> > > > Where can iI find the explanation of the variables of
> > > > structures?
> > >
> > > Not all of Squid is explained. Actually very little of Squid is
> > > explained. The currently best explanation for most things is
> > > the source itself, by tracing how the variable/structure in
> > > question is being used.
> > >
> > > Regards
> > > Henrik

-------------------------------------------------------

Thanks, Henrik pal!

You have clarified all my doubts about "age". :-)

I think your opinion is very right. The name of the variable is not a good one. (Before your explanation, I tried hard to find how to assige a life time of an object to the variable.)

Best regards,
George, Ma
> This "age" variable is specific to the heap policy implementation.
> Not used anywhere else.
>
> In the heap policies the heap key symbols the objects "age" in the
> heap. It do not have a point of origin in time, only the propertity
> that the keys can be sorted.
>
> I am not entirely sure on why the name "age" was selected for this
> specific variable and is why I refer to the paper explaining the
> thinking behind the heap based policy implementation. See the
> description of the LFUDA implementation which was the primary policy
> the heap code was writt! en for (page 4). I think the variable should
> be renamed to heap_age for clarity.
>
> "age" in other parts of Squid usually represents the objects age in
> time. For example in src/refresh.c.
>
> Regards
> Henrik
>
>
>
>
>
>
>
> On Monday 08 April 2002 07:32, 马琳 wrote:
> > Thanks again, Henrik pal!
> >
> > Maybe my English explanation is poor, :-). I understand that
> > variable "age" is referring to the top element of a
> > minimum-value-heap. My question is what is the literature of the
> > variable "age". IMHO, I think the "age" of an object means how long
> > it has been cached in mem/disk since it is first fetched. As I have
> > not read the whole source codes, so I am not very sure about it.
> > Maybe my explanation is not very precise.
> &g! t;
> > I think you are a very warm-heated pal! And cute, :-)
> >
> > Have a nice day,
> > George, Ma
> >
> > > On Sunday 07 April 2002 08:27, 马琳 wrote:
> > > > Hi, I am using squid 2.4 stable. When I am reading the source
> > > > codes, I always run in trouble. Because I do not know the exact
> > > > meaning of thre variables of structures.
> > >
> > > Welcome in the club ;-)
> > >
> > > > For example, in file store_heap_replacement.c, line 108
> > > > heap_key
> > > > HeapKeyGen_StoreEntry_GDSF(void *entry, double age)
> > > > {
> > > > StoreEntry *e = entry;
> > > > heap_key key;
> > > > double size = e->swap_file_sz ? (double) e->swap_file_sz :
> > > > 1.0; double tie = (e->lastref > 1) ? (1.0! / e->lastref) : 1.0;
> > > > key = age + ((double) e->refcount / size) - tie;
> > > > debug(81, 3) ("HeapKeyGen_StoreEntry_GDSF: %s size=%f
> > > > refcnt=%ld lastref=%ld age=%f tie=%f -> %f\n",
> > > > storeKeyText(e->hash.key), size, e->refcount, e->lastref, age,
> > > > tie, key); if (e->mem_obj && e->mem_obj->url)
> > > > debug(81, 3) ("HeapKeyGen_StoreEntry_GDSF: url=%s\n",
> > > > e->mem_obj->url);
> > > > return key;
> > > > }
> > > >
> > > > What is the exact meaning of "age"? Can anyone give me a brief
> > > > explanation?
> > >
> > > In this specific case, age is the currently smallest key in the
> > > heap I think. Perhaps more information is in the paper explaining> > > the heap policies. See lib/heap.c and
> > > src/repl/heap/store_repl_heap.c for the source relating to this
> > > specific "age".
> > >
> > > > Where can iI find the explanation of the variables of
> > > > structures?
> > >
> > > Not all of Squid is explained. Actually very little of Squid is
> > > explained. The currently best explanation for most things is the
> > > source itself, by tracing how the variable/structure in question
> > > is being used.
> > >
> > > Regards
> > > Henrik
>

=============================================================
VIP邮箱出新款,优惠价每月只要4元钱!
用vip邮箱,送《求职宝典》!
定包月短信,送VIP邮箱 !
10元钱能做什么?安全稳定,尽在网易VIP邮箱!
网易VIP邮箱,打个电话立即拥有!
Received on Mon Apr 08 2002 - 08:04:26 MDT

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