Threads don't start after few iterations
I have developed a simulation in which I have used multi-threading. There are 150 threads that run at a time. I have to run the simulation 1000 times .Therefore I put the entire code in a for loop. The simulation run fine for few iterations and after that the threads don't start. While the command prompt still shows that the program is running. The task manager shows that its no longer using the excess portion of CPU it was using in previous iterations.
I thought it would be a problem with Garbage collector so tried running r.gc(); but it does not help.
I also thought that the threads in previous iteration would not have stopped. Therefore I checked weather the thread is still alive or not before proceeding for the next iteration.