Debugging tip

Troubleshooting multi-threaded applications has always been fun. And by fun I mean pulling your hair out kind of fun. The troubleshooting can be especially challenging when the bug involves threading errors. Errors such as race conditions and dead locks can be hard to track down.

One useful thing that I've found is the Debug class in the System.Diagnostics namespace. The Write() method on the Debug class allows you to write debug output to either the output window in Visual Studio or a flat file. The debug output can help to track down where the threading errors are occuring.
«December»
SunMonTueWedThuFriSat
30123456
78910111213
14151617181920
21222324252627
28293031123
45678910