This project has moved and is read-only. For the latest updates, please go here.

The resolvers cache is updated in a non-threadsafe manner


Although the _resolvers[] dictionary is only a "cache" of resolvers, it needs to be synchronized when updated and (at least from the documentation I have found) - if you allow for concurrent read / synchronized write; get operations should also be synchronized:

In theory

A very simple (and highly performant) resolution is to make this cache copy-on-update.

Looking at the code, I would think that it would be difficult to get this to actually fail in practice as some locking is imposed by the generic class initializer when there is a read cache miss.


Grax wrote Jul 17, 2013 at 6:24 PM

I will review this issue further. Thank you for the link and the suggestion

Grax wrote Aug 26, 2013 at 5:38 PM

The one issue mentioned, a situation where something is removed from the dictionary between the time it is found to exist and the time it is used, should not be an issue as we do not remove objects from the dictionary.

Still looking into what bad things could happen during an add or update of the dictionary item.

wrote Nov 29 at 10:18 AM