If I want nonblocking code that is related to IO (say talk to db) without creating a thread, I simply throw async/await everywhere.
If I want to create a thread to do some cpu heavy computation, I add Task.Run and fill in the lambda my sync code (and for sure that requires adding async/await).
This is the way I do async C#... I should say I never tried to check those statements 😁
Also, some operations might lead the OS to create a thread, but that doesn't count on our app process (it's the way the OS does its business instead).
Thanks for the recommendation, I just read her posts and they seem interesting!
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
My rule of thumb is:
If I want nonblocking code that is related to IO (say talk to db) without creating a thread, I simply throw async/await everywhere.
If I want to create a thread to do some cpu heavy computation, I add Task.Run and fill in the lambda my sync code (and for sure that requires adding async/await).
This is the way I do async C#... I should say I never tried to check those statements 😁
Also, some operations might lead the OS to create a thread, but that doesn't count on our app process (it's the way the OS does its business instead).
Thanks for the recommendation, I just read her posts and they seem interesting!