If I have two threads running concurrently in my program and put a breakpoint on one of them, will the other thread stop also halt when this breakpoint is hit, or will it continue executing regardless?
(I am writing in Java and using NetBeans)
If I have two threads running concurrently in my program and put a breakpoint on one of them, will the other thread stop also halt when this breakpoint is hit, or will it continue executing regardless?
(I am writing in Java and using NetBeans)
Breakpoints have an option how they should behave: to suspend a single thread or all threads
I believe that each thread will stop once it hits the breakpoint in the code, while other threads will continue to run. I remember this from my Tomcat days.
It might be interesting to note that in Eclipse and NetBeans the default behavior is to suspend the current thread when the breakpoint is hit, while in IntelliJ it suspends all threads.
By default only the thread that hits the breakpoint stops. However, you can modify the behavior by changing the breakpopint properties.