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 to make Task.WaitAll() to break if any exception happened?

I want to make Task.WaitAll() to break out if any of the running tasks throws an exception, so that …

c# task-parallel-library task async-await
C# async/await chaining with ConfigureAwait(false)

Based on numerous books and blogs including this excellent one here, it is clear that when one writes a dll …

c# .net task-parallel-library async-await io-completion-ports
How to cancel a Task using CancellationToken?

So I've this code: //CancelationToken CancellationTokenSource src = new CancellationTokenSource(); CancellationToken ct = src.Token; ct.Register(() => Console.WriteLine("Abbruch des …

c# task-parallel-library task cancellationtokensource
I/O performance - async vs TPL vs Dataflow vs RX

I have a piece of C# 5.0 code that generates a ton of network and disk I/O. I need to …

task-parallel-library system.reactive async-await conceptual tpl-dataflow
c# lock and listen to CancellationToken

I want to use lock or a similar synchronization to protect a critical section. At the same time I want …

c# multithreading .net-4.0 task-parallel-library cancellation-token
"stream was not readable" ArgumentException when using ReadAsStreamAsync with StreamReader

I have the following piece of code to read and process the response of a Http get request using StreamReader: …

c# stream async-await task-parallel-library streamreader
Continuous polling using Tasks

This is something I've always used Threads / BackgroundWorker for, but am trying to migrate over to Task way of doing …

c# asynchronous task-parallel-library task polling
Waiting on a Task with a OnlyOnFaulted Continuation causes an AggregateException

I have some simple code as a repro: var taskTest = Task.Factory.StartNew(() => { System.Threading.Thread.Sleep(5000); }).ContinueWith((Task …

c# parallel-processing task task-parallel-library pfx
Parallel.ForEach using Thread.Sleep equivalent

So here's the situation: I need to make a call to a web site that starts a search. This search …

c# multithreading task-parallel-library parallel.foreach
How to use C#8 IAsyncEnumerable<T> to async-enumerate tasks run in parallel

If possible I want to create an async-enumerator for tasks launched in parallel. So first to complete is first element …

c# asynchronous async-await task-parallel-library iasyncenumerable