483 Views
So recently, I’ve been moving some older utility classes logic over to use the excellent .NET Task Parallel Library (TPL). This library contains, at it’s core, a class called Task which allows parallel programming without the need of working directly with threads. During this process, I wrote a few extension methods I found to be useful in dealing with tasks in an easier manner, and thought I’d share them in a few posts. Today's will discuss an extension method to make disposing a task a little bit "safer".
@dpeterson: I like it. It's a convenient wrapper around thread pools that makes them easier to work with in general. That said you can get more performance out of threads if you know how to code them correctly, but the TPL is a great level of abstraction on top of them.