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.

Passing a method parameter using Task.Factory.StartNew

I have the following code: var task = Task.Factory.StartNew(CheckFiles, cancelCheckFile.Token, TaskCreationOptions.LongRunning, TaskScheduler.Default); private void CheckFiles() { //…

c# .net .net-4.0 task-parallel-library
How do I wait until Task is finished in C#?

I want to send a request to a server and process the returned value: private static string Send(int id) { …

c# .net task task-parallel-library wait
No ConcurrentList<T> in .Net 4.0?

I was thrilled to see the new System.Collections.Concurrent namespace in .Net 4.0, quite nice! I've seen ConcurrentDictionary, ConcurrentQueue, ConcurrentStack, …

c# .net parallel-processing task-parallel-library
Synchronously waiting for an async operation, and why does Wait() freeze the program here

Preface: I'm looking for an explanation, not just a solution. I already know the solution. Despite having spent several days …

c# .net task-parallel-library windows-store-apps async-await
Awaiting multiple Tasks with different results

I have 3 tasks: private async Task<Cat> FeedCat() {} private async Task<House> SellHouse() {} private async Task&…

c# .net async-await task-parallel-library .net-4.5
What is the difference between Task.Run() and Task.Factory.StartNew()

I have Method : private static void Method() { Console.WriteLine("Method() started"); for (var i = 0; i < 20; i++) { Console.WriteLine("Method() …

c# multithreading task-parallel-library
Parallel foreach with asynchronous lambda

I would like to handle a collection in parallel, but I'm having trouble implementing it and I'm therefore hoping for …

c# async-await task-parallel-library parallel.foreach
WaitAll vs WhenAll

What is the difference between Task.WaitAll() and Task.WhenAll() from the Async CTP ? Can you provide some sample code …

c# asynchronous async-await task-parallel-library
How can I wait till the Parallel.ForEach completes

I'm using TPL in my current project and using Parallel.Foreach to spin many threads. The Task class contains Wait() …

c# task-parallel-library
Simplest way to run three methods in parallel in C#

I have three methods that I call to do some number crunching that are as follows results.LeftFront.CalcAi(); results.…

c# parallel-processing task-parallel-library