dankamongmen / libnetstack

Small library around rtnetlink to track networking stack elements
https://nick-black.com/dankwiki/index.php/Libnetstack
Apache License 2.0
10 stars 0 forks source link

Keep cache of non-deleted objects with fast lookup, thread-safety #12

Closed dankamongmen closed 5 years ago

dankamongmen commented 5 years ago

Now that we're collecting all the various events and can index quickly into them, we need keep a cache. That's pretty trivial; the bigger issue is how to let the calling program share our objects. Can they only copy them out, and they are responsible for killing them off on a deletion event? That seems one sane way, and fine-grained locking with accessors makes the simple case simple. So do both.

dankamongmen commented 5 years ago

We need add some unit tests for this, and I think we'll be ready to go? Also need to make deep copy work by turning pointers into offsets viz the rtablock.