Joe Duffy, the PM on the CLR team responsible for all things threading and concurrency related, put up a terrific blog post yesterday on concurrency and its impact on reusable libraries.  Joe has written for MSDN Magazine several times, and in his blog post he specifically cites one of his articles, No More Hangs: Advanced Techniques To Avoid And Detect Deadlocks In .NET Apps, from our April 2006 issue.  This is quite a cool article.  In it, Joe not only examines the ins and outs of deadlocks and typical solutions used to avoid and detect them, but he provides implementations of a managed lock-leveling class, LeveledLock, as well as a functional CLR host that will detect deadlocks in your apps and print out information about the threads involved.