[ndnSIM] Lru policy lookup and insert function

Alex Afanasyev alexander.afanasyev at ucla.edu
Fri Jun 21 13:05:40 PDT 2013

Hi Pan,

I'm not quite sure what your particular problem is.  Whenever "Lookup" is called before add on a container, it will just return that the item is not in the container and that's it.  There would never be call to the policy, and if you're getting it, then something is wrong with policy-container consistency.

Also, what do you mean by "modify ... how to insert"?  With LRU you always either add to the end or don't add, in which case you have to return false (otherwise you may get inconsistency and crashes).


On Jun 21, 2013, at 1:18 AM, panhgshine at 163.com wrote:

> Hi Alex,
> I have modify a replacement policy based on LRU. I found that if lookup an item that did't insert the list, the program will break. And I read the API of boost::intrusive::list::splice(const_iterator p, list & x, const_iterator new_ele) function. It requires new_ele must point to an element contained in list x. So, I know the reason that program break. But, in real world, if the Lookup function in ContentStoreImpl execute before Add function in ContentStoreImpl, what would happen? And, can I modify the insert function in LRU policy to decide how to insert the item?
> Thank you!
> --Pan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.lists.cs.ucla.edu/pipermail/ndnsim/attachments/20130621/bf7f5273/attachment.html>

More information about the ndnSIM mailing list