<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Dec 7, 2016, at 11:57 PM, John Baugh <<a href="mailto:jpbaugh@umich.edu" class="">jpbaugh@umich.edu</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">ndnSIM friends,<div class=""><br class=""></div><div class="">Once again, I thank you all for your help and patience.</div><div class=""><br class=""></div><div class="">My questions:</div><div class=""><br class=""></div><div class="">1.)  In <b class="">cs-policy-lru.cpp</b>, the doBeforeErase function is as follows:</div><div class=""><br class=""></div><div class=""><div class=""><b class=""><font face="monospace, monospace" class="">void</font></b></div><div class=""><b class=""><font face="monospace, monospace" class=""> LruPolicy::doBeforeErase(iterator i)</font></b></div><div class=""><b class=""><font face="monospace, monospace" class=""> {</font></b></div><div class=""><b class=""><font face="monospace, monospace" class="">   m_queue.get<1>().erase(i);</font></b></div><div class=""><b class=""><font face="monospace, monospace" class=""> }</font></b></div></div><div class=""><br class=""></div><div class="">Note that it is removing an item from the queue, apparently.  However, I was told this is just another copy of the table of iterators that the Cs itself stores?</div><div class=""><br class=""></div><div class="">If this is so, how is this actually having any effect of the contents in the Cs itself?</div></div></div></blockquote><div><br class=""></div><div>doBeforeErase doesn't affect the CS itself. It is being called just before removal of an entry from CS, which has been decided in some other way.</div><br class=""><blockquote type="cite" class=""><div class=""><div dir="ltr" class=""><div class="">2.)  I noticed that there is an <b class="">emitSignal</b> when entries as evicted, and it has beforeEvict as the first argument (in both LRU and Priority Fifo) - what exactly is this signal emission doing?  Does this tell the Cs itself to remove entries?</div></div></div></blockquote><div><br class=""></div><div>Exactly. For LRU policy, this decision process happen on doAfterInsert: if the size of CS becomes larger than the limit, the policy selects an entry (using the policy-managed queue) and emit signal to indicate CS to remove the specified entry.   After that CS will do the job of preparing to remove, call doBeforeErase on the policy, and then actually remove the entry.</div><div><br class=""></div><div>---</div><div>Alex</div><div><br class=""></div><div><br class=""></div></div></body></html>