InternetException

Avoid deadlock with asynchronous methods

· 31 words · ~1 min read · in .NET, interview

#async

  • avoid doing AsyncOperation.Result
  • parent method waits for Result while child method waits for parent thread to take control, after being done with async I/O
  • both waits
  • deadlock

Further read:

https://medium.com/rubrikkgroup/understanding-async-avoiding-deadlocks-e41f8f2c6f5d

https://stackoverflow.com/questions/15021304/an-async-await-example-that-causes-a-deadlock