Lyra
Learn
AI Learning Platform
π Midnight
π Comfort
π₯ Ember
π Paper
β Contrast
Exams
Sign in to track progress
β Back to the lesson
Module 2 Β· Quiz
Async/Await Under Questioning
1. What is the primary function of the `await` keyword in C#?
It blocks the current thread until the task completes
It registers a continuation on a Task and returns the thread to the pool.
It creates a new thread to run the task asynchronously
It increases the execution speed of synchronous methods.
2. What can result from calling `GetDataAsync().Result` in a legacy application?
Increased thread efficiency
Improved scalability
SynchronizationContext deadlock
Default cancellation behavior
3. Why is `async void` only appropriate for event handlers?
It can be awaited like async tasks
Exceptions propagate to the context and can crash the process
It creates a new thread for execution
It is the only way to create asynchronous methods in C#.
4. How should independent asynchronous calls be executed to improve efficiency?
Await each call sequentially
Use `Task.WhenAll` to start and await all at once
Call them but don't await any
Use `Parallel.ForEach` on tasks.
Submit answers
Continue: LINQ, Delegates, and Interfaces β
Review this lesson
Retake quiz