Killing a .NET 4 Task?

.net, multithreading, task-parallel-library

Solution

The `Task` class is designed, and intended, to use the new Cooperative Cancellation model of .NET 4 instead of relying on a destructive "abort" style of cancellation.

There is no direct way to cancel a `Task` (like `Thread.Abort()`, though that's very bad to use in any case), but there is an entire framework in place to provide the tooling to request that the Task cancel itself.

Problem

Can I kill a .NET 4.0 Task object with some method like we could with the old and dangerous Thread.Abort() as discussed in the SO thread (pun intended and save the kittens!) Kenny

Original source

Related problems