Yesterday on SO, i saw a thread asking for a code which some what does this way. I mean, you (manager thread) start number of tasks using TPL APIs and once they are complete
Alternatively you can try using async / await pattern. If you await a Task that means the compiler will automatically generate the ContinueWith for you.
If you use this pattern you can write normal async methods which will itself generate State machine.
Check my post
http://www.codeproject.com/KB/cs/async.aspx
Rx on the other hand can represent your data flow, I mean you can hook a sequence of jobs and subscribe your observable on an Observer.
http://msdn.microsoft.com/en-us/data/gg577609
There's no need to do this yourself at all - use continuations with Task.ContinueWith or Task<T>.ContinueWith. That basically lets you say what to do when a task completes - including executing different code on failure, cancellation, and success.
It also returns a task, so you can then continue when that's completed etc.
Oh, and you can give it a TaskScheduler
, so that from a UI thread you can say, "When this background task finishes, execute the given delegate on the UI thread" or similar things.
This is the approach that C# 5 async methods are built on.