Suppose thread A use 'await' to wait for something to finish on thread B. while B is busy with the workload, A is considered to have been marked with a 'suspension point'. And the execution flow in A will continue with the 'caller' method of the suspended code block. When B is done, it will notify A to continue from the suspension point.
My questions are:
What is the content of the context info kept for the suspension point?
How is the context info be stored?
How does B notify A about it's completion?
How is the context info of A restored? (I think once the context info for A is restored, A will resume from the suspension point 'naturally')
What's the effect of 'async' and 'await' on compiler, respectively. In other words, what special work does the compiler do behind the curtain.