For multi-threaded applicationsProgramDebugging, all development tools have good support, widely used in Windows vs and Unix GDB.
Ms provides a detailed help manual for vs multi-threaded program debugging. You can search for the topic "setthreadname (set thread name)" In msdn to find the topic "debug multi-threaded applications ".
Address in msdn: MS-help: // Ms. msdnqtr. v90.chs/dv_vsdebug/html/9d175bc2-1d95-4c47-9bc3-9755af968a9c.htm
The following text is taken from msdn:
A thread is a sequence of commands that the operating system assigns to it for processing time. Each process running in the operating system contains at least one thread. A process that contains multiple threads is called multithreading.
Computers with multiple processors, multi-core processors, or hyper-threading processes can run multiple threads at the same time. Concurrent processing of multiple threads can greatly improve program performance. However, debugging is more difficult because multiple threads need to be tracked.
In addition, multithreading introduces some new types of potential bugs. For example, two or more threads must access the same resource, but only one thread can access the resource safely at a time. Some form of mutual exclusion must be used to ensure that only one thread can access resources at a time. If the mutex execution is incorrect, a deadlock condition may be formed. Under such conditions, no thread can execute. For debugging, deadlock is particularly difficult to solve.
Visual Studio 2008 provides improved "Thread" windows and other user interfaces to simplify multi-thread debugging. To learn about the new thread processing interface function, the best way is to execute the drill. See Walkthrough: debug multi-threaded applications.
Visual Studio also provides powerful breakpoint and tracking points that are useful when debugging multi-threaded applications. You can use the breakpoint filter to place the breakpoint on a single thread. See how to: specify a breakpoint Filter
Debugging a multi-threaded application with a user interface may be particularly difficult. In this case, you can consider running the application on another machine and using remote debugging. For more information, see install remote debugging.
Content of this section
-
How to: use the "Thread" Window
-
Debug the practical process of a thread through the "Thread" window.
-
How to: switch to another thread during debugging
-
Three methods to switch the debugging context to another thread.
-
How to: Mark threads and cancel marking threads
-
During debugging, mark the thread that requires special attention or set a flag for it.
-
How: on the local machine CodeSet thread name
-
Provide a name for the thread viewed in the "Thread" window.
-
How to: Set the thread name in managed code
-
Provide a name for the thread viewed in the "Thread" window.
-
Walkthrough: debug multi-threaded applications.
-
A tutorial on thread debugging focuses on how to use the functions of Visual Studio 2008.
-
How to: Debug on a high-performance Cluster
-
Technology for debugging applications running on high-performance clusters.
-
Prompt when debugging threads in local code
-
It is a simple technique that is very useful for debugging local threads.
Related chapters
-
How to: specify a breakpoint Filter
-
If you want to place a breakpoint on a single thread, you can use the breakpoint filter.
-
How to: Specify the tracking point/breakpoint operation
-
Tracking points can be used to track program execution without interruption. This is useful at 01:10 for studying issues such as deadlocks.
-
Managed thread processing
-
The thread processing concept in. NET Framework programming, including sample code.
-
Multi-thread processing in components
-
How to use multithreading in. NET Framework components.
-
Multi-thread processing (Visual Basic)
-
The thread processing concepts and sample code for Visual Basic programmers.
-
Use thread processing (C # programming guide)
-
Thread processing concepts and sample code for C # programmers.
-
Multithreading
-
For the concept of thread processing and sample code of C ++ programmers using MFC.
-
How to: Debug remote cluster applications
-
Instructions on how to set remote debugging for applications running on high-performance clusters.
See concepts
Use threads and processes
Install remote debugging
More: Http://blog.donews.com/me1105/archive/2011/02/09/113.aspx