Parallel Extensions

Fri, November 30, 2007, 09:17 AM under dotNET | ParallelComputing
The Parallel Extensions to .NET Framework 3.5 is available! Download and play with the first ever public drop - the December CTP.

If you are then ready to dig into it, I have three 20' screencasts (plus more cooking):
1. Tour of the Samples. A tour of what gets installed to get you started.
2. Declarative data parallelism. This is about PLINQ.
3. Imperative data parallelism. This is about the static Parallel class.

After watching the above, visit the relevant MSDN dev centre. For any questions please use the dedicated online forums. For feedback please use the connect site. If you want to congratulate or blame the product team, visit their blog.

Parallel Extensions videos Errata

Thu, November 29, 2007, 03:01 PM under dotNET
If you watched my videos here, please note the following clarifications:

First, in all videos I am using the old internal sort-of-a codename "PFX". This is no longer used internally or externally. Instead just refer to it as Parallel Extensions.

Second, in the PLINQ video, when I very briefly mention what pipelining does, my description is outdated; for an up to date description of pipelining please see this. Also in the same video I do not make it clear that the ForAll option will *not* allow you to preserve ordering.

Third, in the Parallel video, where I use return sum and imply that it is the same as return 0, I am obviously wrong: The issue is that it’s possible for the first thread to complete so fast that the second thread doesn’t have any work to process. The first thread will store its partial result back into the total sum, but since the thread local selector delegate has captured that total sum variable, the second thread will be initializing its partial sum with the total sum that already includes the first sum’s partial. Thus, you could end up counting values twice so you should use return 0 instead. In the same video, if you really wanted to simulate break, in the parallel version you would have to add a return statement after the ps.Stop() statement that I used.

MSDN Flash 28 Nov

Thu, November 29, 2007, 02:50 PM under Links
The MSDN Flash was delivered yesterday (subscribe here). In the editor's intro you'll find where and when the UK 2008 Launch takes place – you can view this issue online now.

The manycore shift white paper

Thu, November 29, 2007, 01:17 AM under ParallelComputing | Links
"Parallel Computing Initiative Ushers Computing into the Next Era"
A bit high level (marketing?) at times in this 10-page document, but there is definitely some interesting stuff in there - read it!

Futures, promises and dataflow programming

Wed, November 28, 2007, 04:25 PM under ParallelComputing | Links
I am a bit slow so I had to read this page twice on wikipedia, but it was worth it in the end, I think. See if you get it all in one pass: Futures and Promises. Because my imperative head wasn't completely blown away I also spent time trying to grok dataflow programming. Opens your mind doesn't it?

Concurrency and Parallelism

Wed, November 28, 2007, 09:50 AM under ParallelComputing | Links
Via Jason, I discovered this post on the concurrency learning curve and following links from there, I found Intel's view on "data and task parallelism". Interesting stuff!

ThreadPool in .NET Framework v2.0 Service Pack 1

Wed, November 28, 2007, 02:42 AM under dotNET
I was in Joe's session at Tech Ed when he mentioned in passing (almost as a throwaway comment) that there are some changes in the System.Threading.ThreadPool in v3.5. I guessed that what he really meant was changes in v2.0 Service Pack 1 for the ThreadPool class (which I confirmed myself by testing it on my machine). It goes to show you that you cannot rely on API surfacing to discover all the changes in SP1 and somebody should come up with a master list... Anyway, you are probably more interested in what the change is, right?

Apparently, the ThreadPool now defaults to having a max of 250 threads instead of 25. I found this ironic because I recall that the NETCF ThreadPool had 256 in v1.0 and changed to 25 to match the desktop behaviour in v2.0 and I wondered if they caught this change in NETCF v3.5 so they can be in sync again. Seems not :-)

Regardless, remember that starting with v2.0 you can change the max yourself not just through hosting APIs but through the managed SetMaxThreads method. In fact, to validate all of the above, I used the counterpart method, GetMaxThreads that you can try yourself:
  int a, b;
ThreadPool.GetMaxThreads(out a, out b);
MessageBox.Show(a.ToString());
:-)

Blend with VS2008

Tue, November 27, 2007, 05:14 PM under Links
If you are looking for a copy of Expression Blend that works and is supported with VS 2008, look no further than Blend SP1.

Compiler Features in C#3 and VB9

Tue, November 27, 2007, 01:51 AM under Orcas | VisualStudio
Visual Studio 2008 uses C# 3.0 and VB9. It uses the same version of the compiler regardless of which version of the framework you are targeting. I've talked about every new language feature and how they can be used cross-framework before, so I won't repeat myself – jump to item 4 of this post.

All I am going to do in this post is offer the slide we use at UK events that demonstrates pictorially the overlap of features between the two languages and where each one differs in terms of new features. This slide was started by my colleague MikeT (who has a great selection of UK VS2008 resources); I evolved the slide to look like this:

Silverlight for VS2008

Tue, November 27, 2007, 12:52 AM under Links
Silverlight 1.1 Tools Alpha for VS2008 spotted in the wild.