Does async/await should be used with threads to utilize multi core? I understand async/await incompletely, but looks like it doesn't create new threads and doesn't use thread pool. So it runs code on current thread, that means no multi core support.
async-await isn't about load-balancing work across multiple cores. It is about taking advantage of operations that are asynchronous by nature and releasing resources to process more work while at it. Good asynchronous APIs dont use extra threads to execute work. Usually, There is no Thread, meaning code will continue to execute on the same thread until hitting the first await and yield control back to the caller.
You can look at examples of async APIs such as HttpClient, StreamWriter, SmtpClient, etc. They all process work over the wire (network driver calls, disk drive calls, etc).
If what you're looking for is parallel processing, look into the Parallel class.
You can also start by reading Parallel Programming in the .NET Framework
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With