Avoid deadlock in threading
The best and careful planning may avoid deadlocks.There are so many ways Microsoft has provided by which you can decrease deadlocks for example Interlocked classes, Monitor, Event raising, Wait handles from one thread to other thread, ThreadState property which you can poll and act accordingly etc.