When is a Threadpool thread returned to the thread pool

663 views Asked by At

If a method is running on a thread tool thread and it awaits another method, will it return to the thread pool during the await so that it can possibly execute another task?

1

There are 1 answers

0
David Browne - Microsoft On BEST ANSWER

If a method is running on a thread pool thread and it awaits another method, will it return to the thread pool during the await so that it can possibly execute another task?

Yes. That's the essential purpose of await The thread exits the method, returning a Task to the calling code. Then the thread goes on with whatever it was doing, typically either running a message loop on a UI, or being returned to the thread pool.