Open main menu

CDOT Wiki β

Changes

GPU621/Pragmatic

36 bytes added, 00:16, 13 November 2016
Updated page structure
*''All notes are based on the material outlined in "Debug Multithreaded Applications in Visual Studio" section of MSDN documentation at:'' [https://msdn.microsoft.com/en-us/library/ms164746.aspx https://msdn.microsoft.com/en-us/library/ms164746.aspx] ''and other related MSDN documentation.''
'''Entry on: November 6th 2016by Vadym Karpenko'''
'''===Debug Multithreaded Applications in Visual Studio'''===
While parallel processing of multiple threads increases program performance, it makes debugging task harder, since we need to track multiple threads instead of just one (Master thread). Also some potential bugs are introduced with parallel processing, for example, when race condition (When multiple processes or threads try to access same resource at the same time, for more information visit [https://en.wikipedia.org/wiki/Race_condition Race Condition Wiki]) occurs and mutual exclusion is performed incorrectly, it may create a deadlock condition (When all threads wait for the resource and none can execute, for more info visit [https://en.wikipedia.org/wiki/Deadlock Deadlock Wiki]), which can be very difficult to debug.
Visual Studio provides many useful tools that make multithreaded debugging tasks easier.
'''===Debug Threads and Processes'''===
A process is a task or a program that is executed by operating system, while a thread is a set of instructions to be executed within a process. A process may consist of one or more threads.
'''===Debug Multiple Processes'''===
Configuration:
# To change how Stop Debugging affects attached processes, open to Processes window (Crtl + Alt + Z), right click on individual process and check/un-check the "Detach when debugging stopped" check box;
'''Entry on: November 9th 2016by Vadym Karpenko'''
'''===How to: Use the Threads Window'''===
Threads window columns:
'''===How to: Set a Thread Name'''===
Thread name can be set using SetThreadName function provided by Microsoft:
'''===How to: Use the Parallel Watch Window'''===
Parallel Watch window columns:
54
edits