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.

TaskCompletionSource : When to use SetResult() versus TrySetResult(), etc

I'm trying to wrap my head around the TPL, the new async / await features in C# 5, and the mysteries of …

c# asynchronous task-parallel-library async-await c#-5.0
Parallel.Foreach maintain collection order?

Is there a way to guarantee order when using Parallel.ForEach()? The collection I am looping over needs to maintain …

asp.net-4.0 parallel-processing task-parallel-library parallel-for
I want await to throw AggregateException, not just the first Exception

When awaiting a faulted task (one that has an exception set), await will rethrow the stored exception. If the stored …

c# task-parallel-library c#-5.0 async-await
Benefits of using BufferBlock<T> in dataflow networks

I was wondering if there are benefits associated with using a BufferBlock linked to one or many ActionBlocks, other than …

c# .net task-parallel-library tpl-dataflow
Terminate or exit C# Async method with "return"

I was new to the async-await method in C# 5.0, and I have few questions in my mind What is the …

c# asynchronous task-parallel-library async-await cancellation-token
Creating a Task with a heartbeat

I'd like to run a Task that has a "heartbeat" that keeps running at a specific time interval until the …

c# .net task-parallel-library async-await azureservicebus
Why *not* change the priority of a ThreadPool (or Task) thread?

There are many places across the web and Stack Overflow where one is discouraged from changing the priority of a …

.net task-parallel-library task threadpool thread-priority
TaskCreationOptions.LongRunning option and ThreadPool

TPL uses Task Schedulers to coordinate tasks. According to official document, default task scheduler uses Thread Pool, but if TaskCreationOptions.…

c# .net-4.0 scheduled-tasks task-parallel-library threadpool
Using Task or async/await in IHttpAsyncHandler

Since the very begining of writing ASP.NET applications when I wanted to add a threading there are 3 simple ways …

asp.net threadpool task-parallel-library async-await ihttpasynchandler
Why does iterating over GetConsumingEnumerable() not fully empty the underlying blocking collection

I have a quantifiable & repeatable problem using the Task Parallel Library, BlockingCollection<T>, ConcurrentQueue<T> &…

c# .net wpf task-parallel-library blockingcollection