Are checkpoints getting latency?

How does this breakpoint setting in my code allow the following code to complete, which would not have worked otherwise.

Here's the problem.

I am writing an add-on for SAP B1 and faced the following problem.

When I load the form, I would like to enter some values ​​into the form matrix.

But without a breakpoint (set on the method in which the form is loaded), some of the code that will be executed after that will fail. This piece of code is referencing a matrix that is not yet displayed, which results in an exception. It's all clear. But why setting a breakpoint "fixes" the problem.

What's happening?

I suspect that my breakpoint introduces some delay between loading and displaying my form and the piece of code that references an element on that form, but I could be wrong.

+2


a source to share


4 answers


Running under the debugger slows down your application and often hides race conditions even without a breakpoint. When you enter a breakpoint, it's even more likely to hide the race conditions. These problems can be difficult to resolve. You might want to introduce some simple protocols (like log4net) to see what's going on without affecting the application so much that you see different behavior. Just keep in mind that even writing may be enough to change something.



+2


a source


The presence of breakpoints means that each time a module is loaded at runtime, Visual Studio scans the module for possible breakpoints. This should result in a delay.



+1


a source


Is this a Windows Forms application? (I'm afraid I don't know anything about SAP B1) Try putting your code in the form load event if it doesn't already exist. Some controls are not ready to be used correctly until a handle is assigned to them, which will not run until the Windows message loop has run multiple times.

+1


a source


Breakpoints introduce some delay. A checkpoint is the addition of additional instructions for the regular execution of your programs. Both hardware and software checkpoints ADD something to the program's execution (although the amount will vary greatly).

http://en.wikipedia.org/wiki/Breakpoint

+1


a source







All Articles