Can anybody give a simple Deadlock sample code in c# ? And please tell the simplest way to find deadlock in your C# code sample. (May be the tool which will detect the dead
There is one more way to achieve deadlock in C#. Since .NET 2.0 SP1 number of threads in pool are limited to 250 (from 25 in previous version) per core.
So, techically, you can start too many tasks in pool that wait for completion for another async operation (that is executed through thread pool). Therefore, task in pool will not be released and async task will not start because there are no available threads.
You can find example and more precise explanation here: Programming the Thread Pool. Deadlocks