Async, CancellationToken, and IProgress in 5 Short Examples

Async code isn’t always intuitive, but practicing helps. Let’s take a look at Async, CancellationToken, and IProgress, in a few short examples.

  Oct 7, 2024 (rev. Sep 16, 2025) ·  8 min

How to call an async method from a synchronous one, without deadlocking

Writing async code whenever possible is great, but how do we do it when we’re stuck with legacy (and very synchronous) code?

  Aug 11, 2023 (rev. Sep 16, 2025) ·  7 min

Converting a BackgroundWorker to a Task with TaskCompletionSource

Sometimes the safer way to “update” old code is to leave it be and paint over it with a newer construct. Let’s see how to modernize a BackgroundWorker using Tasks and TaskCompletionSource.

  Dec 6, 2022 (rev. Sep 16, 2025) ·  9 min

Using Async, Await, and Task to keep the WinForms UI responsive

Using the async/await pattern in WinForms is an easy win, helping prevent one of the most annoying user experiences - a frozen UI.

  Jun 7, 2021 (rev. Sep 16, 2025) ·  8 min