I have a C++ program that uses 2 threads. The program runs fine in Debug and Release mode when run through Visual Studio. However, when run as a stand-alone application it always stalls. I tried to add in printf messages so that I could output the information to the screen, but that just fixed my problem. I take the messages back out and I’m back to the original problem again.
Anyone have any wise words of wisdom to share for an issue like this?
You can simply run the program stand-alone, wait until it deadlocks and then attach the Visual Studio using “Tools”->”Attach To Process…”.
Then select your process and when you are attached, press Pause.
You can then use all debugger features and watch all your threads, stacks and variables…