Monday, May 13, 2013

Async/Await - Best Practices in Asynchronous Programming


Async/Await - Best Practices in Asynchronous Programming by Stephen Cleary is nice article.
Best practices of using Async/Await.
1. Avoid Async Void
2. Async All the Way
3. Configure Context

Preventing the Deadlock - two best practices
    a. In your "library" async methods, use ConfigureAwait(false) wherever possible on UI Form or ASP.NET context (not happen in Console because it uses threadpool)
    b. Don't block on Tasks; use async all the way down.

No comments:

Post a Comment