Does .NET resume an await continuation on a new different thread pool thread or reuse the thread from a previous resumption?
Let\'s image below C# code in a .NET Core co
As you can see Why is the initial thread not used on the code after the awaited method? it is quite possible to resume on another thread, based on what is available at the moment.
In asynchronous programming there is not definite usage of specific threads when used with async await. You only know that an available thread will be picked from the thread pool.
In your case, since the execution is pretty much sequential, the thread is freed and you get the number 4.
Based on the thread pool documentation https://docs.microsoft.com/en-us/dotnet/standard/threading/the-managed-thread-pool the thread pool is unique per process, so I'd expect the usage of the first available thread to be used. So is you have no other concurrent operations, the thread 4 will be reused each time. There are no guarantees though.