>It sounds like updating the data dictionary is not done very often. I assume that all access/updates to the data dictionary is done through this Data class that you mentioned, so you should be able to control it all from there. Something like this might be the way to handle this (sorry, this is going to be in C#, and also un-tested off the top of my head):
>
>
>// in your method that updates the data dictionary
>this.UpdatingDD = true;
>lock (lockObjDD)
>{
> // do the updating stuff here
>}
>this.UpdatingDD = false;
>
>// in your method that needs to use the data dictionary
>if (this.UpdatingDD == false)
>{
> lock (lockObjDD)
> {
> // do your data dictionary stuff here
> }
>}
>
>
>Unfortunately, you probably still have to do the "expensive" lock when you're accessing the data dictionary to prevent the situation where UpdatingDD is false, but a split second later it might be true, so you'll need to lock.
The main problem is that I am using a .Remove() approach and .Add() next to update an entry in the NameObjectCollectionBase. Instead of doing that, maybe I could just update the entry instead. However, I am not sure if the NameObjectCollectionBase supports the update of an entry once it is created. If that could work, then, this would resolve the issue.
Do you know if it is possible to update an entry in a NameObjectCollectionBase collection?