Sunday, February 10, 2019

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:

  1. Create a class with 2 internal System.Collections.Generic.Dictionary and heavily lock all r\w operations.
  2. Use LiteDB over MemoryStream.
  3. Use MultiKeyMap with some kind of keys wrappers and locks
  4. 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?

Multikey concurrent dictionary Click here
  • Blogger Comment
  • Facebook Comment

0 comments:

Post a Comment

The webdev Team