title: Multithreading CSLA.NET
body: <p>I have a program that we'd like to multi-thread at a certain point. We're using CSLA for our business rules. At a one location of our program we are iterating over a BusinessList object and running some sanity checks against the data one row at a time. When we up the row count to about 10k rows it takes some time to run the process (about a minute). Naturally this sounds like a perfect place to use a bit of TPL and make this multi-threaded. </p>
  
  <p>I've done a fair amount of multithreaded work through the years, so I understand the pitfalls of switching from single to multithreaded code. I was surprised to find that the code bombed within the CSLA routines themselves. It seems to be related to the code behind the CSLA PropertyInfo classes. </p>
  
  <p>All of our business object properties are defined like this:</p>
  
  <pre><code>    public static readonly PropertyInfo&lt;string&gt; MyTextProperty = RegisterProperty&lt;string&gt;(c =&gt; c.MyText); 
  public string MyText { 
  get { return GetProperty(MyTextProperty); } 
  set { SetProperty(MyTextProperty, value); } 
  }
  </code></pre>
  
  <p>Is there something I need to know about multithreading and CSLA? Are there any caveats that aren't found in any written documentation (I haven't found anything as of yet).</p>
  
  <p>--EDIT---</p>
  
  <p>BTW: the way I implemented my multithreading via throwing all the rows into a ConcurrentBag and then spawning 5 or so tasks that just grab objects from the bag till the bag is empty. So I don't think the problem is in my code. </p>