Couple of multithreaded bugs

Developer
Jul 1, 2008 at 12:30 AM
Hey guys,

I fixed a couple of bugs that showed up during some multithreaded stress testing.  Check out the latest ChangeSet - http://www.codeplex.com/umbrella/SourceControl/DirectoryView.aspx?SourcePath=&changeSetId=11171.  The biggest one was ValueSupport.cs.  I changed it to use a synchronized dictionary instead of just plain old dictionary.  I kept getting hit by InvalidOperationException because of an enumeration change.  Basically what was happening is I am calling "someString".Conversion().To<SomeEnum>() which eventually gets into ValueSupport.  I am doing the above conversion on many different threads so it failed.

Also, for anything marked with [ThreadStatic], you can't do inline initialization like the previous code did.  The first thread that hits will trigger the new.  All others will simply get the default value (null).

Justin Rudd
Coordinator
Jul 7, 2008 at 11:24 PM
Hi Justin,

This is great news! I'll make sure to have a look into it asap.