CslaDataProvider IsAsynchronous=true performance Issue

CslaDataProvider IsAsynchronous=true performance Issue

Old forum URL: forums.lhotka.net/forums/t/6616.aspx


ixman posted on Tuesday, March 17, 2009

Hi,

I have a small problem with the CslaDataProvider and I don’t know what’s the correct way to solve it. I have a WPF Page with a ViewModel object as DataContext. In the ViewModel I have more CslaDataProviders, usually not more than 3-4. One is for the main Use case purpose and the rest for other related data that needs to be loaded. My problem is that the CslaDataProviders somehow block each other because of the ThreadPool way of handling the worker threads. I’ve replaced the ThreadPool with a classic new Thread(...) and the surprise was that is running twice as fast than using the ThreadPool. I know that creating the Thread in the classic way is more memory expensive and it’s not working well for more than 10 worker threads...but still there is a big performance issue here. Did you experienced this or am I doing something wrong?
I also know that the ThreadPool is recommended for short operations, but we're building LOB applications, so there could be operations that take more time to process.


Thanks

ixman replied on Friday, March 20, 2009

I see that I have no luck with this one so far... I'll post again when I'll find a solution...

Thanks,

RockfordLhotka replied on Friday, March 20, 2009

fwiw, in .NET 4.0 Microsoft is enhancing the thread pool in some interesting ways, so hopefully it will do a better job of supporting concurrent tasks like this.

ixman replied on Friday, March 20, 2009

Hi Rocky,

I actually found an old implementation of a Managed Thread Pool (quick search ManagedThreadPool) written by Stephen Toub from Microsoft and I’ve tested it. The results are very good, but only for long running operations (more than 5-7 seconds let’s say). It improved my processing time by 50% which is quite nice.

Thanks,

Copyright (c) Marimer LLC