I have a 2nd thread where i run a never ending loop (it listens to incoming TCP request).
In that thread/loop i update a dictionary with holds my core data. In my winform GUI i would like to access the dictionary and display info. However if i write a foreach loop i get the exception that the dictionary has been modified.
How do i safely access that dictionary? I tried clone but there is no clone method. I dont want a lock to access it. I wanted to do something like invoke however it doesnt appear i can invoke a function in a thread?
So how do i access this?