Threads no more
There's a phrase that's really stuck in my mind and whenever I either violate it myself or someone else has violated it, I consider the alternative or talk to my colleague about the options:
if you use 'new Thread' you've failed!
-- DotNetRocks; Carl Franklin and Richard Campbell
Hard
There's no debate: threading is hard. Thankfully, the .NET Framework is now full of great abstractions that I find I almost never need to go down to actually managing threads myself. There's the ThreadPool, Timer, Manual/AutoResetEvent, Parallel, Task, PLINQ and the 'Begin/End' async pattern. Add to that I'm finding the concurrent collections especially useful recently: such as the BlockingCollection and ConcurrentDictionary.
Of course, with the upcoming .NET4.5 / C#5 changes, the Begin/End pattern will be really improved with the new async/await syntax.
Efficiency
So just think next time you might be about to new up a new Thread and consider the alternatives. You might even find the alternative is faster or more memory efficient: don't forget a new Thread will allocate 1MB of virtual address for it's local stack so being profligate with Threads is soon going to use up a lot of memory. Embrace the abstractions!
