Few days ago I got an exception while enumerating a Dictionary<>. It was a null pointer exception for a key object. Since the keys in a dictionary may not be null I've started to dig and found the reason - multi threading writers to a dictionary without locks can cause null key (even if the writing was before the enumeration).
Solution: locks.
Wednesday, September 26, 2007
Subscribe to:
Post Comments (Atom)
2 comments:
Thanks, you've saved me a whole lot of trouble trying to figure out what went wrong...
Thank you very much!!!! You saved me a lot of research time too.
Regards,
JMP
Post a Comment