I have a method which does 2 independent pieces of logic. I was hoping I can run them both at the same time .. and only continue afterwards when both those
By far the easiest way to do this is to use Parallel.Invoke()
IList cats;
IList food;
Parallel.Invoke
(
() => cats = GetAllTheCats(foo),
() => food = GetAllTheFood(foo)
);
Parallel.Invoke() will wait for all the methods to return before it itself returns.
More information here: http://msdn.microsoft.com/en-us/library/dd460705.aspx
Note that Parallel.Invoke() handles scaling to the number of processors in your system, but that only really matters if you're starting more than just a couple of tasks.