An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
you mean to say await creating another thread to execute this one returnedTaskTResult ?
No. I mean exactly what I wrote.
not clear properly from your explanation. please be elaborate. thanks
The official Task asynchronous programming model (TAP) documentation does an excellent job illustrating what happens in an asynchronous method. Read the official documentation.
Background:
Asynchronous programming has been around a very long time and it has always been very difficult to organize the code. There was an asynchronous caller, an asynchronous response handlers, code to run while waiting for the response, handling any data returned within the asynchronous response handler and using the result in the code. The Task asynchronous programming model (TAP) simplifies the code developers write while the compiler hides the complexity of asynchronous programming.
Briefly:
When the main thread hits your GetTaskOfTResultAsync method it just keeps on going until is comes to point where it has nothing else to do which is usually the last await in the chain of async/awaits or the end of a method if there's no await. An await is the location in the code where the code needs the results from the asynchronous method to move on because downstream code needs the results. Well, the main thread has noting to do when it gets to the last await and it returns to the thread pool (Core) for other processes to use. Once the asynchronous method finishes then another thread takes over to run any remaining code.
The asynchronous method must be making a call that is not CPU bound. For example, making an HTTP request.
Please read the official documentation which explains each step of an asynchronous method call more thoroughly than I can in a forum post.