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

  • SEARCH
  • Home
  • 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 8198105
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T05:52:53+00:00 2026-06-07T05:52:53+00:00

I have investigated this issue now since some time and it seem obvious to

  • 0

I have investigated this issue now since some time and it seem obvious to me that the placement of ordinary breakpoints influences the runtime behavior of the program dramatically.

I am speaking here of conditional breakpoint e.g. when setting the breakpoint condition to var == null then this case never occurs but when I remove the breakpoint the situation that var == null occurs often.

Could that be ?

Appendix:

Well my code is multi-threaded so it’s hard to post code in order to reproduce the error. Basically I have two threads. One is enqueuing items in a queue and the other is permanently dequeing items from the queue. In the code-snipped below I have the situation that the first thread never enqueues null items but for some reason they are finding their way into the queue. That let me insert the if-statement in order to prevent the NullReferenceException. Although being a temporary workaround my program did run from then on. Then I was interested in how often a null item gets dequeued from the queue and I placed a conditional breakpoint in the line with the if statement with the condition inv == null. The effect now is, when there is a breakpoint inv never seems to be null and when there is no breakpoint inv seems to be often null.

public void _dequeue () {

            while (!Signals.TerminateSignal.WaitOne(0, false)) {

                if (Signals.DequeueSignal.WaitOne()) {

                    lock (Queue) {

                        IInvocation inv;
                        Queue.TryDequeue(out inv);

                        // Conditional Breakpoint
                        if (inv != null)
                            inv.Invoke();

                        _poolHooks[PoolIndex].DecrementWaiting();
                        _poolHooks[PoolIndex].IncrementPending();

                        if (Queue.Count == 0) Signals.DequeueSignal.Reset();

                    }
                }
            }
        }

Again my problem began when some items in the queue began to be null items although I never add null items. Even for that reason I have placed a line that throws an Exception when there is something null. The Exception never gets thrown but I still have null items in my queue and I have no clue why.

public static void EnqueueInvocation (int poolIndex, IInvocation inv ) {

        if (inv == null) throw new Exception("Red Alert");

        lock (_deqThreads[poolIndex].Queue) {

            _poolHooks[poolIndex].IncrementWaiting();


            _deqThreads[poolIndex].Queue.Enqueue(inv);
            _deqThreads[poolIndex].Signals.DequeueSignal.Set();
        }
    }
  • 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-06-07T05:52:54+00:00Added an answer on June 7, 2026 at 5:52 am

    “conditional breakpoints” definitely affect timing. If you have a race condition it will definitely change behavior. You could also start seeing timeouts.

    This is because there is no such thing as a true “conditional breakpoint” on most processors. What you actually have is “breakpoint, followed conditionally by automatically resuming execution”, and that is pretty slow even when the condition isn’t satisfied, because the debugger breakpoint handler has to run, read memory, test the condition, and then issue a continue.


    Now that you’ve posted your code, I think I see the problem.

    You’re not checking the return value of TryDequeue. When there’s nothing to dequeue, inv will be null, not because null was put into the queue, but because no items are in the queue at all.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

OK, now that I have investigated the code, there are no cookies to speak
I have found already some similar discussion on this, but would like to investigate
I've investigated several C# DLL's and have not found any that work especially well.
have written this little class, which generates a UUID every time an object of
The Problem I've been developing for Android for quite some time now. One of
I have investigated an issue around binary serialization of a IComparable property which causes
First, thanks for taking the time to read this. I'm having some difficulties with
I have http://parent.com that opens a pop-up on http://parent.com:8888 (this is in development, in
I have a C struct that contains a function pointer. Now, I have used
have a problem. At first look at this HTML <div id=map style=background-image: url(map.png); width:

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.