Should one use Task.Run within another Task?
问题 I have a bunch of work to do (either CPU-bound or IO-bound with no async interface to use) within a Task. I'm wondering if it's OK to just do all the non-async work within the task like this: async Task DoSomeStuff() { await SomethingAsync(); … DoCpuBoundWork(); … await SomethingElseAsync(); } or should I use Task.Run like this? async Task DoSomeStuff() { await SomethingAsync(); … await Task.Run(() => DoCpuBoundWork()); … await SomethingElseAsync(); } I know tasks aren't necessarily executed