Debugging a multithreaded application can be very messy and difficult. One developer memorably compared the difficulty of testing and debugging free-threaded code with performing a tonsillectomy while entering the patient from the wrong end. Understanding the common problems that can afflict a multi-threaded application is key to creating a program design that avoids the need to perform heavy debugging. The examples of problem behavior discussed in this chapter are best avoided by designing your thread interactions very carefully . The ThreadGui example application presents one design pattern that avoids thread interaction problems.