I was wondering whether it\'s true that async
-await
should not be used for \"high-CPU\" tasks. I saw this claimed in a presentation.
So I guess
Unless CalculateMillionthPrimeNumberAsync
constantly uses async/await
by itself, there is no reason not to let the Task to run heavy CPU work, since it just delegates your method onto ThreadPool's thread.
What a ThreadPool thread is and how does it differ from a regular thread is written here.
In short, it just takes the threadpool thread into custody for quite a time (and the number of threadpool threads is limited), so, unless you are taking too many them, there is nothing to worry about.