• Post Reply Bookmark Topic Watch Topic
  • New Topic

Need help on Threads

 
Sanju Shah
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello All,

I have a dilemma and I'm hoping that somebody would shed some light on it. I'm fairly new to java so please bare with me...

In my java application, I have created a pool of thread whose max thread is around 100. I have a run method which has the part where it has application logic. Everything runs smoothly but after sometime I can see that the application logic within the run method stops executing which made me believe that that the pool might have reached the max thread. SO to avoid that I check before executing the application logic if the max thread is reached then I bump up the thread max thread. But that didn't seem to resolve the problem. I still see the issue happening.

So my question any idea as to why is it still happening and any hints or suggestions ... I hope the back ground information that I have provided is clear ... Also are there any checks that I can go with regard to threads available in the pool?

Thanks
 
Edwin Dalorzo
Ranch Hand
Posts: 961
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you contemplated the possibility of a deadlock. If your threads are accessing syncrhonized code in a resource shared by all of them there are posibilties that two or more of your threads are blocked trying to acquire a lock on a mutually shared resource that will never be released.
 
Edward Harned
Ranch Hand
Posts: 291
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You've encountered the classic problem of multi-threading. You have backend threads and you don't know what they are doing.

Have a look here:
http://coopsoft.com/JavaShadow.html

You want backend processes, then you need a backend process manager.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!