Parallel Programming: Task Schedulers and Synchronization Context

Yes, it does everything that I wanted, but it uses the WPF API extensively. Although it is perfectly fine to use WPF as shown above, with the TPL you can make your code much less dependent on the particular UI framework. Right now, if you copy and paste the button event handler and the SumRootN method to a Windows Forms application with almost identical UI, you would need to do a lot of work, because Windows Forms doesn't have the Dispatcher object and uses different API for managing interactions with the UI thread.

Continue reading here ...