Showing tag results for .NET 4

Nov 21, 2010
Post comments count0
Post likes count1

Processing Sequences of Asynchronous Operations with Tasks

Stephen Toub - MSFT
Stephen Toub - MSFT

Of late, I’ve seen multiple folks asking about how to use tasks to asynchronously execute a sequence of operations.  For example, given three synchronous functions: public string DoA(string input); public string DoB(string aResult); public string DoC(string bResult); you could invoke these functions with code like: strin...

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

New Feature? :: Delayed cancellation

Danny Shih
Danny Shih

 We’re interested in adding support for scheduling cancellation.  For example: // Create a token source that will Cancel() after a delay var cts = new CancellationTokenSource(TimeSpan.FromMilliseconds(100));// And/or schedule a Cancel() call cts.CancelAfter(TimeSpan.FromMilliseconds(100));We’ve heard from many folks that ...

.NET Parallel Programming
Oct 15, 2010
Post comments count0
Post likes count0

FAQ :: StartNew() with TaskScheduler.FromCurrentSynchronizationContext() doesn’t work?

Danny Shih
Danny Shih

We’ve seen a number of folks write the following code to execute on the UI thread and get unexpected behavior. TaskScheduler uiScheduler = TaskScheduler.FromCurrentSynchronizationContext();Task uiTask = Task.Factory.StartNew(delegate{    // … Update UI component; BUG!}, uiScheduler);The issue is that the StartNew ca...

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

Creating pre-completed Tasks

Danny Shih
Danny Shih

 We’ve been considering adding support for creating completed Tasks from an existing result.  Here’s a prototypical example of where this could be valuable. void Task<float> ComputeAsync(...) {     if (!resultIsCached)     {         return Task<floa...

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

“C# 4.0 in a Nutshell” parallel programming content

Stephen Toub - MSFT
Stephen Toub - MSFT

Joe Albahari, author of "C# 4.0 in a Nutshell", has just published on his Web site the material from his book covering Parallel Extensions.  You can find his extensive article here:https://www.albahari.com/threading/part5.aspxNice work, Joe.

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

FAQ :: TaskScheduler.UnobservedTaskException event doesn’t work?

Danny Shih
Danny Shih

Recall that if exceptions thrown from Task bodies are left unobserved, they will be escalated.  In .NET 4, this means that TPL will throw them on the finalizer after the Task objects are available for garbage collection.  The UnobservedTaskException event on the TaskScheduler class was added as a last-resort method to observe such excepti...

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

Microsoft Biology Foundation 1.0 Released

Stephen Toub - MSFT
Stephen Toub - MSFT

It's exciting to see that the Microsoft Biology Foundation 1.0 has been released!  You can read more about it here.  From MBF's Web site:"The Microsoft Biology Foundation (MBF) is a language-neutral bioinformatics toolkit built as an extension to the Microsoft .NET Framework, initially aimed at the area of Genomics research. Currentl...

.NET Parallel Programming
Jul 2, 2010
Post comments count0
Post likes count0

Using Cancellation Support in .NET Framework 4

Igor Ostrovsky - MSFT
Igor Ostrovsky - MSFT

The .NET Framework 4 introduces a new mechanism for cancellation of operations, based on new types CancellationToken and CancellationTokenSource. This cancellation mechanism is used across the parallel programming libraries: tasks, concurrent collections, and PLINQ queries.Using Cancellation Support in .NET Framework 4, written by Mike Li...

.NET Parallel Programming
Jun 30, 2010
Post comments count0
Post likes count0

PLINQ and Office Add-ins

Igor Ostrovsky - MSFT
Igor Ostrovsky - MSFT

Many different kinds of applications can benefit from multi-core parallelism, including add-ins to Microsoft Office. Donny Amalo wrote a paper, PLINQ and Office Add-ins, where he demonstrates how to implement two parallel Microsoft Office add-ins using PLINQ: (This paper and many more are available through the Parallel Computing Developer C...

.NET Parallel Programming
Jun 28, 2010
Post comments count0
Post likes count0

Integrating Parallelism with Windows Workflow Foundation

Igor Ostrovsky - MSFT
Igor Ostrovsky - MSFT

Despite the similarity in naming, the System.Threading.Tasks.Parallel class and the System.Activities.Statements.Parallel* activities in WF4 are largely orthogonal in the scenarios they address. However, WF4 activities and the new parallel programming types in .NET 4 can be used together to great advantage.Ling Wo and Cristina Manu wrote a pap...

.NET Parallel Programming