Apr 9 in C Sharp (C#)

Name some of the most common places to look for a Deadlock in C#.

1 Answer

Apr 9

For recognizing deadlocks, one should look for threads that get stuck on one of the following:

  • .Result, .GetAwaiter().GetResult(), WaitAll(), and WaitAny() (When working with Tasks)
  • Dispatcher.Invoke() (When working in WPF)
  • Join() (When working with Threads)
  • lock statements (In all cases)
  • WaitOne() methods (When working with AutoResetEvent/EventWaitHandle/Mutex/Semaphore)
Click here to read more about C Sharp
Click here to read more about Insurance

Related questions

Apr 8 in Interview Question
Nov 9 in Drupal
Oct 18, 2019 in C Sharp (C#)