Is yield return in C# thread-safe?
What exactly do you mean by thread-safe? You certainly shouldn’t change the dictionary while you’re iterating over it, whether in the same thread or not. If the dictionary is being accessed in multiple threads in general, the caller should take out a lock (the same one covering all accesses) so that they can lock for … Read more