Showing tag results for Code Samples

Apr 13, 2010
Post comments count0
Post likes count0

ParallelExtensionsExtras Tour – #9 – ObjectPool

Stephen Toub - MSFT
Stephen Toub - MSFT

(The full set of ParallelExtensionsExtras Tour posts is available here.) An object pool is a mechanism/pattern to avoid the repeated creation and destruction of objects.  When code is done with an object, rather than allowing it to be garbage collected (and finalized if it’s finalizable), you put the object back into a spe...

.NET Parallel Programming
Apr 12, 2010
Post comments count0
Post likes count0

ParallelExtensionsExtras Tour – #8 – ReductionVariable

Stephen Toub - MSFT
Stephen Toub - MSFT

(The full set of ParallelExtensionsExtras Tour posts is available here.) The new .NET 4 System.Threading.ThreadLocal<T> is quite useful when you need per-thread, per-instance storage.  This is in contrast to the fast ThreadStaticAttribute, which supports only per-thread storage (in .NET 4, ThreadLocal<T> actually layers o...

.NET Parallel Programming
Apr 9, 2010
Post comments count0
Post likes count0

ParallelExtensionsExtras Tour – #7 – Additional TaskSchedulers

Stephen Toub - MSFT
Stephen Toub - MSFT

(The full set of ParallelExtensionsExtras Tour posts is available here.)In our last two ParallelExtensionsExtras blog tour posts, we’ve discussed two TaskScheduler implementations in ParallelExtensionsExtras: StaTaskScheduler and ConcurrentExclusiveInterleave.  These are just 2 of more than 10 schedulers in ParallelExtensionsExtras, and ...

.NET Parallel Programming
Apr 8, 2010
Post comments count0
Post likes count0

ParallelExtensionsExtras Tour – #6 – ConcurrentExclusiveInterleave

Stephen Toub - MSFT
Stephen Toub - MSFT

(The full set of ParallelExtensionsExtras Tour posts is available here.)   As mentioned in the previous ParallelExtensionsExtras blog tour post, the Task Parallel Library (TPL) supports an extensible task scheduling mechanism, and we demonstrated how an StaTaskScheduler could be implemented that scheduled tasks onto custom STA threa...

.NET Parallel Programming
Apr 7, 2010
Post comments count0
Post likes count0

ParallelExtensionsExtras Tour – #5 – StaTaskScheduler

Stephen Toub - MSFT
Stephen Toub - MSFT

(The full set of ParallelExtensionsExtras Tour posts is available here.)  The Task Parallel Library (TPL) supports a wide array of semantics for scheduling tasks, even though it only includes two in the box (one using the ThreadPool, and one using SynchronizationContext, which exists primarily to run tasks on UI threads).  This ...

.NET Parallel Programming
Apr 5, 2010
Post comments count0
Post likes count0

ParallelExtensionsExtras Tour – #3 – Additional Task Extensions Methods

Stephen Toub - MSFT
Stephen Toub - MSFT

(The full set of ParallelExtensionsExtras Tour posts is available here.)  In our last ParallelExtensionsExtras tour post, we discussed implementing an extension ToObservable method for Task<TResult>.  This is just one of a myriad of extra pieces of functionality that are useful with Tasks, and the TaskExtrasExtensions.cs f...

.NET Parallel Programming
Apr 4, 2010
Post comments count0
Post likes count0

ParallelExtensionsExtras Tour – #2 – Task.ToObservable

Stephen Toub - MSFT
Stephen Toub - MSFT

(The full set of ParallelExtensionsExtras Tour posts is available here.)  In our previous ParallelExtensionsExtras tour post, we discussed a custom implementation of the LINQ operators, in particular for working with Task<TResult> instances in an asynchronous manner. There is already an impressive implementation of the LINQ ope...

.NET Parallel Programming
Apr 4, 2010
Post comments count0
Post likes count0

ParallelExtensionsExtras Tour – #1 – LINQ to Tasks

Stephen Toub - MSFT
Stephen Toub - MSFT

(The full set of ParallelExtensionsExtras Tour posts is available here.) The .NET Framework developer center provides a concise description of Language Integrated Query (LINQ):LINQ is a set of extensions to the .NET Framework that encompass language-integrated query, set, and transform operations. It extends C# and Visual Basic with nativ...

.NET Parallel Programming
Apr 4, 2010
Post comments count0
Post likes count0

A Tour of ParallelExtensionsExtras

Stephen Toub - MSFT
Stephen Toub - MSFT

Throughout the development of Parallel Extensions for the .NET Framework 4, we’ve come across a myriad of situations where certain functionality would be useful in developing a particular application or library, but where that functionality isn’t quite encapsulated in the bits we’re shipping.  Sometimes this functionality is ...

.NET Parallel Programming
Feb 9, 2010
Post comments count0
Post likes count0

Maintaining a Consistent Application State with TPL

Zlatko Michailov - MSFT
Zlatko Michailov - MSFT

The aim of this post is to help developers writing applications in which operations may need to be performed and then later undone due to a subsequent failure. It shows a pattern for how to maintain such a consistent application state by utilizing functionality from the Task Parallel Library (TPL) in the .NET Framework 4. For the purposes of this ...

.NET Parallel Programming