Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6686735
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T05:12:23+00:00 2026-05-26T05:12:23+00:00

I have a multi-threaded application that I’m debugging inside the IDE (Visual Studio 2008,

  • 0

I have a multi-threaded application that I’m debugging inside the IDE (Visual Studio 2008, Win7-64, C++).

For “debugging” purposes, I “pretend” that I always have a single processor (the program detects the number of local processors), but the program design establishes a minimum of two threads (e.g., the “main thread” which handles GUI and event traffic, and a second “processing” thread where work is moved off of the “main thread”). (In a “production” build there would be a single main thread, and one-or-more “processing” threads depending on the number of detected processors.)

ISSUE: Breakpoints in the code (within the IDE) sometimes are triggered, and sometimes not. Re-running the program may “catch” on a break point where the previous run it did not “catch” (no source code changes or rebuild is performed to see this change-in-breakpoint-catch-behavior, the program execution path is identical).

(I mostly only care about triggering breakpoints in the non-GUI/non-main-thread, but I assume that should not matter.)

QUESTION: Is there a way to make these break points catch more “reliably”? (What influences whether a break point “catches” or not?)

I’m aware of, and NOT concerned with the following:

  • Source is out-of-sync with latest linked executable
  • Build is not “debug” (no debug symbols available)
  • “Clean build” is needed (debug artifacts out-of-date)
  • “Step Over/Into” may not work properly when another thread “breaks”
    during that first thread’s stepping operation

On web searches, there was a mention of possibly setting the compiler setting to “x86” and not “Any Processor” to catch breakpoints, not sure why that might matter … ?

Finally, yes, of course, all logic “should” be tested in a single-threaded application (e.g., re-factor to ensure deterministic single-threaded execution for unit and regression tests). However, for the current testing, I need to be in the “real” application (think “integration testing” or “systems integration”).

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T05:12:23+00:00Added an answer on May 26, 2026 at 5:12 am

    Normally breaking is extremely reliable. Here are some things to try:

    1. Hard code a breakpoint with DebugBreak(). This should always be caught, but if this exhibits the same broken behavior, you have narrowed down the problem.
    2. Where you currently have the bp set, add a line to print to screen/file, and set the breakpoint on that line. This is to be certain this line is really even being hit. You may have a strange, unexpected bug that is actually skipping the entire section unexpectedly and this is necessary to be sure.
    3. Try with and without any optimizations. Debugging works best with all optimizations off, but even with deadstripping and inlining features at work, breakpoints are expected to still work. Does this issue occur even with optimizations off?
    4. You say ISO C++, does this mean you’ve actually switched off all microsoft extensions? I’ve never compiled this way in visual studio, but if you have, try switching extensions back on and see if that has any effect.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a multi-threaded Windows application that occasionally deadlocks. Inevitably this happens on a
I have a multi-threaded Windows C++ app written in Visual Studio 6. Within the
I have a multi-threaded application that is using pthreads. I have a mutex() lock
I have a multi-threaded .NET application that occasionally terminates without any message. When I
I have a multi-threaded Delphi 6 Pro application that I am currently working on
I have created a multi-threaded application that runs fine on every system except for
I have a fairly complex multi threaded application (server) that from time to time
I have a multi-threaded application that has a centrlaised list that is updated (written
I have a multi threaded application that writes to a settings xml file using
I have a PHP based multi-threaded application that I'm try to get working with

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.