Threads and Load Occurrence Breakpoints

If you set a load occurrence breakpoint for a DLL that has not been loaded, you may find that, in a multithreaded program, the DLL never triggers the breakpoint, even though it must have been loaded by a call to a function within it. The usual cause of a load occurrence breakpoint not triggering is that you associated the breakpoint with a particular thread.

To avoid this problem, choose "every" in the Optional Parameters group box in the Load Occurrence Breakpoint window, to have the load occurrence breakpoint trigger regardless of which thread first calls a function within it. The debugger tells you which thread triggered the load.

For all breakpoint types, you can specify a breakpoint at the same location but with different conditions for different threads. For example, you can set a breakpoint that is triggered in thread 1 when the variable a has the value 3, and a breakpoint at the same location triggered in thread 2 when the variable a has the value 4. Conditions on thread-specific breakpoints can be useful for determining whether you have thread data integrity problems.



Debugging Threads