New answers tagged

0

Let's imagine that after doing each test, you had to analyze some data you recorded, and write those results out, and lets say that analysis is a somewhat computationally expensive operation and can't start until all the data is collected, while the configuration of the hardware and recording the data is cheap but it a lot of waiting. It could then make ...


1

Async/await is just syntactic sugar for using Tasks. In fact, async/await makes the code able to be more procedural rather than get caught in the callback pit. For instance, one (not great) way to run a task after another task would be: var task = StartSomething(); var continuation = task.ContinueWith(t => { var task2 = StartSomethingElse(t.Result); ...


0

I'd leave well enough alone. There is a time and place for sequential code and it sounds like you have a textbook example. Async/await are useful tools, but not the right tools for the problem you're solving. Put this another way, which code would be easier to maintain - your current code or code restructured to use async/await?



Top 50 recent answers are included