Netbeans hangs while exit after completing executing for multiple thread
I have multiple thread in my class that implements runnable class. The runnable class is basically responsible to update status(Open/Completed) of a child order. For each child orders I am maintaining a Thread.
In the run() method, i have a while loop which terminates loop for all threads upon certain condition (achieved through volatile variable & condition is if the child order is completed) and hence all thread gets terminated after exit from while and completes run().
Now i have another class(say Main class) that invokes this run() method of my runnable class for all child orders. My main class keep on checking status for each child order (checking status of all child order inside a loop of main class). Upon receiving status as completed for any of child order, I am terminating loop of main class and updating the test case as passed in database.
While executing the above scenario, in case if i have more then two threads, my IDE and entire system hangs and even task manager is not working in such cases.As a result, I have to explicitly re-start my system. But the test case gets executed successfully at the back-end and database is also updated accordingly. I don't know why multiple threads are causing problem to IDE?
Please suggest what should be done.
Re: Netbeans hangs while exit after completing executing for multiple thread
What makes you think it is an issue with your IDE? Have you run the code independent of it?
I don't know why multiple threads are causing problem to IDE?
Post an SSCCE, without which we can only guess, mine being that you are spawning several threads which are working 100%, in essence overloading your system CPU's