Top "Task-parallel-library" questions

The Task Parallel Library is part of the .NET Framework since .NET 4. It is a set of APIs to enable developers to program asynchronous applications.

How do you catch CancellationToken.Register callback exceptions?

I am using async I/O to communicate with an HID device, and I would like to throw a catchable …

c# task-parallel-library cancellationtokensource
What is the difference between Task<> and IAsyncOperation<>

I am writing a metro app. This works: HttpClient client = new HttpClient(); var bytes = await client.GetByteArrayAsync(new Uri("www.…

.net task-parallel-library microsoft-metro
C# async tasks in a queue or waiting list

i have an async Task like this: public async Task DoWork() { } And i have at the moment a: List<…

c# task-parallel-library async-await throttling
How can I prevent synchronous continuations on a Task?

I have some library (socket networking) code that provides a Task-based API for pending responses to requests, based on TaskCompletionSource&…

c# .net task-parallel-library task async-await
Aborting a long running task in TPL

Our application uses the TPL to serialize (potentially) long running units of work. The creation of work (tasks) is user-driven …

c# task-parallel-library cancellation
how can i force await to continue on the same thread?

await does not guarantee continuation on the same task for spawned tasks: private void TestButton_Click(object sender, RoutedEventArgs e) { …

c# asynchronous task-parallel-library synchronizationcontext
How do Reactive Framework, PLINQ, TPL and Parallel Extensions relate to each other?

At least since the release of .NET 4.0, Microsoft seems to have put a lot of effort in support for parallel …

system.reactive plinq parallel-extensions task-parallel-library
Distinguish timeout from user cancellation

HttpClient has a builtin timeout feature (despite being all asynchronous, i.e. timeouts could be considered orthogonal to the http …

c# .net timeout task-parallel-library dotnet-httpclient
Using a hashtable inside a Parallel.ForEach?

I have a Parallel.ForEach loop running an intensive operation inside the body. The operation can use a Hashtable to …

c# .net parallel-extensions task-parallel-library
Parallel.Foreach spawning way too many threads

The problem Although the code about which I will talk here I wrote in F#, it is based on the .…

.net f# parallel-processing task-parallel-library parallel-extensions