- Will PerformCalc() be called synchronously on the same thread as the one that called Run()?
Yes.
- Will DoLongTaskAsync() be called asynchronously or synchronously? In other words, will PerformAnotherCalc() be called before DoLongTaskAsync() has finished?
It will be called synchronously, but it may return a Task before the "Long Task" operation has finished. Either way, the Task it returns is awaited, so PerformAnotherCalc will not be called until the Task returned from DoLongTaskAsync completes.
- Subsequently, can the DoStuffAsync() method return before execution of DoLongAsyncTask() has completed?
The DoStuffAsync method will return when it hits the first await (iff the Task being awaited is pending). That's how async methods work -- they run synchronously up until the first await of a Task which is pending, and then they return a Task which will complete when the whole method has executed.
If might be that DoLongTaskAsync returns a Task which has already completed: in that case, DoStuffAsync won't return until PerformAnotherCalc has returned. If DoLongTaskAsync returns a Task which is still pending, then DoStuffAsync will return at that point, and it will return a Task which completes once the Task returned from DoLongTaskAsync has completed, and PerformAnotherCalc has returned.
DoLongTaskAsyncis indeed asynchronous and returns an uncomplete task) return but not complete.