Join the DZone community and get the full member experience.Join For Free
last night i had the opportunity to present at the gwinnett microsoft .net user group. the topic i chose is not a new one, but an important one. recently in several interviews i've been surprised to learn how little is truly understood about multi-threading in managed code and specifically the use of the async and await keywords. this presentation was designed specifically to walk through the basics behind threading and demonstrate when and how it is useful. the abstract and deck are below, along with a link to the repository with sample code.
although two new keywords have been lurking in c# for years now, many people still don't fully understand what they do or how they facilitate asynchronous programming. contrary to what some developers seem to believe, tagging a method as async doesn't make it run in a separate thread and await doesn't pull threads from the thread pool. these contextual keywords cause the compiler to generate complicated code so you don't have to with numerous advantages from improving the responsiveness of your application, simplifying the source, and enabling better scale. learn exactly how async and await work, what happens under the covers, when you should use them and how to write your own apis to take advantage of async and await whether it's in windows runtime, desktop, or web-based applications. ( full source and deck )
Published at DZone with permission of Jeremy Likness, DZone MVB. See the original article here.
Opinions expressed by DZone contributors are their own.