async

Task, async, and await: the lifetime of asynchronous workPublished At:

Follow a method that needs an HTTP response, from starting the request to returning a parsed result. See how the HTTP task and the method's own task carry different parts of the work.

The walkthrough covers what await does while the response is pending, how failures and cancellation reach the caller, and where the method continues afterward.

engineering software-development #csharp #dotnet #async

Read more ...

Async, concurrency, and parallelism are differentPublished At:

Async, concurrency, and parallelism answer different questions. Async avoids blocking during I/O waits, concurrency keeps independent operations moving in the same period, and parallelism spreads CPU-bound calculations across cores.

The distinction guides the implementation: use async for external waits, concurrency when independent waits can overlap, and parallelism only after measurement identifies a CPU bottleneck.

engineering software-development #csharp #dotnet #async #concurrency #parallelism

Read more ...

Why async programming existsPublished At:

Async code yields while I/O waits on a database, network, file system, timer, or remote service. The external operation takes the same time, while the application can keep a UI responsive or serve other work.

This is different from parallel computation. Async improves how waiting is handled; it does not remove the underlying I/O delay or make CPU-bound work faster by itself.

engineering software-development #csharp #dotnet #async

Read more ...