HomeChallengesRepsProblemsLeaderboardTake a challenge

Blocking the thread

.Result, async void and Thread.Sleep in one method. Undo all three.

Beginner20 min on the clock5 graded checks · 100 pointsC# FoundationsPro
Graded by reading your code against the checklist below.

What you build

  • Await the calls rather than blocking on them
  • Return a Task so the caller can await you
  • Accept a CancellationToken and pass it down
  • Wait without holding a thread
  • Let the two independent calls overlap

Done means

Nothing blocks, nothing is fire-and-forget, and the work is cancellable.

How it is graded

Published in full, before you start — every point is one of these and there is nothing else.

  1. Await instead of blocking on .Result+25async and await
  2. Return a Task, never async void+20async and await
  3. Thread a CancellationToken through+20async and await
  4. Wait without parking a thread+15async and await
  5. Overlap the independent calls+20async and await

What it teaches

The rest of C# Foundations