Multikey concurrent dictionary
I'm trying to find an implementation of multi(2)-key concurrent dictionary. I need to access, add and delete value by either of two keys. All keys will be unique. Keys will have different types. All of the items should be in RAM, i don't need to store them.
These are the options that came to my mind so far:
- Create a class with 2 internal System.Collections.Generic.Dictionary and heavily lock all r\w operations.
- Use LiteDB over MemoryStream.
- Use MultiKeyMap with some kind of keys wrappers and locks
- Writing my own dictionary
I don't really like any of them. Options 1 and 3 are too whacky-hacky, using a whole database seems like an overkill with performance penalties. Did i miss anything? Does anone know any lib that contain suitable datastructure? Any other suggestions?
0 comments:
Post a Comment