Showing results for Code Samples - .NET Parallel Programming

Jun 9, 2008
0
0

Image Colorizer Sample in the June 2008 CTP

Mike Liddell
Mike Liddell

Continuing the tour of the samples included in the Parallel Extensions June 2008 CTP, we now turn our attention to the "Image Colorizer" application.   This sample uses the following constructs from Parallel Extensions: System.Threading.Parallel.For() and also the following from the standard .NET libraries: System.ComponentModel.BackgroundWor...

Parallel ExtensionsTask Parallel LibraryCode Samples
Jun 6, 2008
0
0

Mandelbrot in Parallel with C++/CLI

Stephen Toub - MSFT
Stephen Toub - MSFT

Since the release of the December 2007 CTP of Parallel Extensions, we've received several questions about whether Parallel Extensions can be used from C++/CLI.  In short, yes, it can! (It can be used with any .NET language, one of the beauties of this functionality being provided through a library.)  To demonstrate, we included in the Jun...

Parallel ExtensionsTask Parallel LibraryCode Samples
Jun 4, 2008
0
0

Ray Tracer samples in the June 2008 CTP

Mike Liddell
Mike Liddell

The June 2008 Community Technology Preview (CTP) of Parallel Extensions to the .NET Framework was released on Monday, and we’re really pleased at the level of excitement in the community that we’re seeing in response.  As part of the CTP, we included a  variety of demos and samples to help provide a tour of the functionality.  If you...

Parallel ExtensionsTask Parallel LibraryCode Samples
Jun 2, 2008
0
0

What’s New in the June 2008 CTP of Parallel Extensions

Stephen Toub - MSFT
Stephen Toub - MSFT

We've just released a new community technology preview (CTP) of Parallel Extensions to the .NET Framework!  You can download it from https://www.microsoft.com/downloads/details.aspx?FamilyId=348F73FD-593D-4B3C-B055-694C50D2B0F3.  This release contains a plethora of bug fixes as well as some design changes to address some great feedback fr...

Parallel ExtensionsTask Parallel LibraryCode Samples
May 28, 2008
0
0

Multiple thread-local state elements in a loop

Stephen Toub - MSFT
Stephen Toub - MSFT

The Parallel.For/ForEach loop constructs included in Parallel Extensions support a variant of thread-local state to aid in efficiently passing data between loop iterations.  Consider one such overload of Parallel.For: public static void For<TLocal>( int fromInclusive, int toExclusive, Func<TLocal> threadLocalInit, Actio...

Parallel ExtensionsTask Parallel LibraryCode Samples
Mar 16, 2008
0
0

Wrapping an APM implementation with Future

Stephen Toub - MSFT
Stephen Toub - MSFT

In a previous post, I talked about implementing the Asynchronous Programming Model pattern using Future<T> from Parallel Extensions to the .NET Framework.  It's also possible to go in the opposite direction, to create a Future<T> from an existing APM implementation.As has been shown in previous examples, in this example we'll take ...

Parallel ExtensionsTask Parallel LibraryCode Samples
Mar 13, 2008
0
0

Parallel loop performance

Stephen Toub - MSFT
Stephen Toub - MSFT

We've received several questions on the MSDN Forums for Parallel Extensions about the performance of the Parallel class, and specifically of the loop constructs we provided in the CTP.  We're very much aware that the performance of Parallel.For/ForEach in the CTP is not optimal, and that for some situations, the overhead for these constructs w...

Parallel ExtensionsTask Parallel LibraryCode Samples
Mar 12, 2008
0
0

Ordering the output of parallel computations

Stephen Toub - MSFT
Stephen Toub - MSFT

Frequently when attempting to do multiple operations in parallel, ordering becomes an issue.  Consider an application where I'm rendering and writing out to a video file frames of a movie: for (int i = 0; i < numberOfFrames; i++){    var frame = GenerateFrame(i);    WriteToMovie(frame);}For a bit of pizzazz, I'...

Parallel ExtensionsTask Parallel LibraryCode Samples
Feb 29, 2008
0
0

Implementing the Asynchronous Programming Model with Future

Stephen Toub - MSFT
Stephen Toub - MSFT

One of our design goals for the Task Parallel Library is to integrate well into existing asynchronous mechanisms in the .NET Framework.  And one of the most common concurrency-related patterns in the .NET Framework is the Asynchronous Programming Model (APM), which typically manifests as a BeginXx method that kicks off an asynchronous operatio...

Parallel ExtensionsTask Parallel LibraryCode Samples
Feb 27, 2008
0
0

Custom parallel looping constructs

Stephen Toub - MSFT
Stephen Toub - MSFT

For those of you that have examined the internals of the Task Parallel Library in our December '07 CTP release, you've likely noticed that the methods on the System.Threading.Parallel type are implemented on top of System.Threading.Tasks.Task type, and that they do so taking advantage of Task's self-replicating functionality.  The idea behind ...

Parallel ExtensionsTask Parallel LibraryCode Samples