Showing results for Code Samples - .NET Parallel Programming

Jan 31, 2008
0
1

Recursion and Concurrency

Stephen Toub - MSFT
Stephen Toub - MSFT

When teaching recursion in an introductory computer science course, one of the most common examples used involves a tree data structure.  Trees are useful in this regard as they are simple and recursive in nature, with a tree's children also being trees, and allow for teaching different kinds of traversals (in-order, pre-order, post-order...

Parallel ExtensionsTask Parallel LibraryCode Samples
Dec 10, 2007
0
0

Code Snippets for Parallel.For and Parallel.ForEach

Stephen Toub - MSFT
Stephen Toub - MSFT

Introduced in Visual Studio 2005, Code Snippets allow you to quickly insert reusable blocks of code into your project.  For example, if you want to quickly write a for loop in C#, you can simply type "for" into your code file, and IntelliSense shows you the "for" code snippet: Now you press the tab key twice, and Visual Studio...

Parallel ExtensionsTask Parallel LibraryCode Samples
Dec 7, 2007
0
0

Parallelizing a query with multiple “from” clauses

poojanagpal
poojanagpal

Consider a simplified version of Luke Hoban's LINQ ray tracervar Xs = Enumerable.Range(1, screenWidth);var Ys = Enumerable.Range(1, screenHeight); var sequentialQuery =   from x in Xsfrom y in Ysselect new { X = x, Y = y, Color = TraceRay(x, y) }; If the screen width is much larger than the screen height, we would choose to para...

Parallel ExtensionsCode SamplesPLINQ
Dec 2, 2007
0
0

Chunk partitioning vs range partitioning in PLINQ

Stephen Toub - MSFT
Stephen Toub - MSFT

If you look in the PLINQ samples in the December 2007 CTP, you'll see a parallel implementation of Luke Hoban's LINQ ray tracer.  The sample parallelizes the ray tracer by changing very few lines of code.   Luke's original query started as follows: from y in Enumerable.Range(0, screenHeight)For our sample, we've changed that to: from...

Parallel ExtensionsCode SamplesPLINQ
Nov 29, 2007
0
0

Task Parallel Library changes since the MSDN Magazine article

Stephen Toub - MSFT
Stephen Toub - MSFT

Back in the October 2007 issue of MSDN Magazine, we published an article on the beginning stages of what has become the Task Parallel Library (TPL) that's part of the Parallel Extensions to the .NET Framework.  While the core of the library and the principles behind it have remained the same, as with any piece of software in the early sta...

Parallel ExtensionsTask Parallel LibraryCode Samples