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.

Async-await Task.Run vs HttpClient.GetAsync

I'm new to c# 5's async feature. I'm trying to understand the difference between these two implementations: Implementation 1: private void …

c# asynchronous task-parallel-library async-await c#-5.0
Best way to convert callback-based async method to awaitable task

What would be the best way to convert/wrap a "classic" asynchronous method that uses a callback to something that …

c# asynchronous task-parallel-library c#-5.0
When to use TaskCreationOptions.LongRunning?

I've wondered this for quite a while, but never really found the answer. I understand that it's a hint for …

c# multithreading task-parallel-library task
Why CancellationToken is separate from CancellationTokenSource?

I'm looking for a rationale of why .NET CancellationToken struct was introduced in addition to CancellationTokenSource class. I understand how …

c# multithreading task-parallel-library cancellationtokensource cancellation-token
Is there anything like asynchronous BlockingCollection<T>?

I would like to await on the result of BlockingCollection<T>.Take() asynchronously, so I do not block …

c# .net collections task-parallel-library async-await
Is there a Threadsafe Observable collection in .NET 4?

Platform: WPF, .NET 4.0, C# 4.0 Problem: In the Mainwindow.xaml i have a ListBox bound to a Customer collection which is …

wpf .net-4.0 c#-4.0 observablecollection task-parallel-library
Task.Factory.StartNew or Parallel.ForEach for many long-running tasks?

Possible Duplicate: Parallel.ForEach vs Task.Factory.StartNew I need to run about 1,000 tasks in a ThreadPool on a nightly …

c# .net c#-4.0 task-parallel-library parallel-for
TPL TaskFactory.FromAsync vs Tasks with blocking methods

I was wondering if there were any performance implications between using TPL TaskFactory.FromAsync and using TaskFactory.StartNew on blocking …

c#-4.0 task task-parallel-library networkstream taskfactory
"The calling thread must be STA" workaround

I know there are a few answers on this topic on SO, but I can not get any of the …

wpf multithreading task-parallel-library dispatcher sta
Is Task.Run considered bad practice in an ASP .NET MVC Web Application?

Background We are currently developing a web application, which relies on ASP .NET MVC 5, Angular.JS 1.4, Web API 2 and Entity …

c# asp.net asp.net-mvc async-await task-parallel-library