I have been following the development of the .NET Task Parallel Library (TPL) with great interest since Microsoft first announced it.
There is no doubt in my mind that we will eventually take advantage of TPL. What I am questioning is whether it makes sense to start taking advantage of TPL when Visual Studio 2010 and .NET 4.0 are released, or whether it makes sense to wait a while longer.
I would start now. I strongly suspect that we've seen the bulk of the changes - even if there are a few tweaks in the release candidate, I'm sure they'll be well documented in the PFX team blog, and easy to change. Even if chips change, I'd expect the TPL to adapt appropriate in future versions - and I would personally expect that the current TPL is still likely to do a better job of handling those new chips than any hand-crafted threading code mere mortals like us could write.
The one real downside I see to starting now is that the learning resources aren't really there yet. There's some documenation, some blog posts (some of which will be outdated by now) and some sample code - but no books dedicated to PFX. I'm sure those will come in time though - and if you're early in the game, you could even write one :)
Depending on your application, you might also want to look at Reactive Extensions, which works hand-in-hand with PFX.
In the end, it matters more if your core engine can benefit from parallelism in general. Does it have lots of shared state that needs to be guarded with locks? if that is true, can that be easily moved to a design centered around lock-free data structures?
I think those questions must be answered first, so that you can them have a clearer picture to assess if TPL may help down the road.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With