Link to home
Start Free TrialLog in
Avatar of jdcoburn
jdcoburn

asked on

Dictionary and a struct

hi -- I'm using C# and VS2010 with .net 4.
i have a dictionary that i use to keep state information in my program. the value part of the key value pair is a struct (called "node"). it seems that i can only update "node" as a single entity rather than updating individual elements when i have fresh data. i have the additional problem of the data coming from two different threads. i set up the dictionary as static and use flags to protect the write operation. but every now and then (every couple hours) i get an enumeration error, which i suspect is related to the update process.
is there a better approach?
thanks,
ASKER CERTIFIED SOLUTION
Avatar of kaufmed
kaufmed
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of jdcoburn
jdcoburn

ASKER

thanks. all the solutions added value in different ways.<br />Jim