<div dir="auto">Alex<div dir="auto"><br></div><div dir="auto">Thank you for the response!  </div><div dir="auto"><br></div><div dir="auto">So, to make sure I'm understanding this:. The Policy subclass maintains a secondary table of iterators essentially (e.g., a queue) - when the Policy implementation decides it's time for a specific entry to be removed, it should remove it from its own table, but emit a signal to tell the Cs which entry to remove as well.</div><div dir="auto"><br></div><div dir="auto">Is this correct?</div><div dir="auto"><br></div><div dir="auto">Thanks</div><div dir="auto"><br></div><div dir="auto">John</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Dec 8, 2016 12:41 AM, "Alex Afanasyev" <<a href="mailto:aa@cs.ucla.edu">aa@cs.ucla.edu</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><br><div><blockquote type="cite"><div>On Dec 7, 2016, at 11:57 PM, John Baugh <<a href="mailto:jpbaugh@umich.edu" target="_blank">jpbaugh@umich.edu</a>> wrote:</div><br class="m_900947179566164621Apple-interchange-newline"><div><div dir="ltr">ndnSIM friends,<div><br></div><div>Once again, I thank you all for your help and patience.</div><div><br></div><div>My questions:</div><div><br></div><div>1.)  In <b>cs-policy-lru.cpp</b>, the doBeforeErase function is as follows:</div><div><br></div><div><div><b><font face="monospace, monospace">void</font></b></div><div><b><font face="monospace, monospace"> LruPolicy::doBeforeErase(<wbr>iterator i)</font></b></div><div><b><font face="monospace, monospace"> {</font></b></div><div><b><font face="monospace, monospace">   m_queue.get<1>().erase(i);</font></b></div><div><b><font face="monospace, monospace"> }</font></b></div></div><div><br></div><div>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><br></div><div>If this is so, how is this actually having any effect of the contents in the Cs itself?</div></div></div></blockquote><div><br></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><blockquote type="cite"><div><div dir="ltr"><div>2.)  I noticed that there is an <b>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></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></div><div>---</div><div>Alex</div><div><br></div><div><br></div></div></div></blockquote></div></div>