Sunday, May 2, 2010

The Toronto Code Camp shows us how to scale data tier with Windows ServerAppFabrics and Parallel Computing in Microsoft’s .net 4.0

The Toronto Code Camp shows us how to scale data tier with Windows ServerAppFabrics and Parallel Computing in Microsoft’s .net 4.0

This post combines two sessions I went to during the Toronto Code Camp at York University.

This is involved the Window’s caching techniques of a layer from Microsoft’s cloud computing technology called Azure. The one piece of technology is called AppFabric.
The first component involved a web configuration file which is a deployable config file. This cache can be used any programming language not just on a web development language like ASP.NET which can be done through Microsoft’s Windows Communication Foundation API (WCF).

The first part to initiate AppFabric would be executed as an administrator on Window’s Server’s Powershell utility. There would be a number of commands at your disposal to initiate AppFabric with the Powershell. These include get-cachehelp, use-cachecluster, and start-cache cluster. Ensure you download and install AppFabric before using these. These are not out of the box within Windows Server editions but can only be installed on Windows Server R2. This object need to serialize but does support either binary or XML modes.

The second session involved an important session on parallel computing within Microsoft’s .NET 4.0 This was presented by SysFusion Inc’s Clay Burch. The new .NET 4.0 has some new classes including System.Threading,Tasks, PLINQ (parallel LINQ), and Thread Pool. This also includes looping methods Thread.For, Parallel.ForEach, and Parallel.Invoke. The presenter also showed PLINQ which is new to .NET 4.0 which is a LINQ object using Task under the wraps.

Clay then proceeded with a classic matrix multi example to show their threading research. There was a demo sample but did mention their demo Lenova ThinkPad’s laptop has a low end L3 cache which adversely affected the system’s performance. The L3 cache was too slow.

Their code sample uses a signal manual reset which had a special atomic decrement and Signal.Set(). There was also task class of a worker item (Thread Pool) and Factory set. There was also Parellel.For which was the fastest and uses delegates.
There was also an Analyze Tool which could be found in the Visual Studio Professional edition and higher. This tool shows the concurrenies and testing and multitasking in a visual chart.

As for Windows garbage collector, you would minimize memory collection and potentially make the garbage collector single threaded. Also, you could can turn the server GC (Garbage Collector) through a system XML file. The presenter also mentioned about replaces classes with structures instead of using the heap. He also mentioned about using a row major in a deep matrix versus a column major. PLINQ can be expensive delegates.

The session ended with some useful resources for Windows parallel programming. There was an epic white paper written by Stephen |Todd called Patterns of Parallel Programming. Also mentioned was Dan’s Moth’s channel 9 presentation on the MSDN site.

No comments:

Post a Comment