Re: Multi-Core processors and Csla

Re: Multi-Core processors and Csla

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


ozitraveller posted on Sunday, September 16, 2007

Hi

Is multi-core processing likely to effect csla?

"Optimize Managed Code For Multi-Core Machines"

http://msdn.microsoft.com/msdnmag/issues/07/10/Futures/default.aspx

 

RockfordLhotka replied on Sunday, September 16, 2007

That's an interesting paper at a theoretical level. And they are correct, in that applications do need to become more parallel.

Unfortunately the real world is a lot more complex. Windows Forms and WPF are single-threaded technologies, and ASP.NET is designed to hide its multi-threaded nature from the developer.

So were you to use a Parallel.For(), and in that loop try to raise events or otherwise influence the UI (directly or indirectly) you'd be toast.

The WPF support in CSLA does include a CslaDataProvider control, and it supports async loading of data. This concept is built into WPF to provide a safe way to do multi-threading, where WPF paints the screen as best it can without data, and then when the data load is complete on the background thread, the resulting object is made available to WPF to do data binding.

You can do a similar thing using the BackgroundWorker component in Windows Forms, though WinForms doesn't have a formal concept of a data provider like WPF. But the concept is sound.

I guess the answer is "sort of', but not in the free-form sense of that article, because there are way too many ways to shoot yourself in the foot when writing a real application that uses raw multi-threaded concepts.

Copyright (c) Marimer LLC