O'Reilly logo

C# 5.0 Unleashed by Bart De Smet

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Synchronization Behavior of await Expressions

Asynchronous operations usually complete on a different thread than the one making the initial request to perform the operation. You’ve seen this repeatedly when studying the APM, EAP, and TAP patterns earlier in this chapter. This is a direct artifact from the way asynchronous completion of I/O operations is carried out on the thread pool. When dealing with compute bound asynchrony, the background thread that performed the computation will likely also be the one signaling the operation’s completion.

This decoupling from the requestor’s original context has traditionally posed an additional inconvenience, requiring manual synchronization for example to update the UI with the operation’s result. A ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required