Saturday, November 29, 2014

.Net 4.5 Async Await for a more responsive design

Writing this so I'll remember the details. There is a good resource on the Await and Async keywords in MSDN: http://msdn.microsoft.com/en-us/library/hh191443.aspx

The key thing is that the execution is released back to the event loop until the async method is executed and completed. So there is no blocking of the event loop causing rendering problems in the GUI.

There is a lot of arrows in the sample in MSDN but the summary is that code will go back and resume executing the "continuation" after the async method has completed. This is great for long-running processes like downloading resources.

1 comment:

Ralph Carpenter said...

What amazes me most is the execution is realeased back to the event loop untill the async method is ececuted and comleted. Keep up with the great job of sharing this here.