I have a application which is deployed in tomcat 6
In this application I have created a thread class which fetches 1000 records from a table and process them and store in 4 different tables in DataBase.
I am running two threads at a time to protect the process from deadlock.
Is there any way to schedule these threads accordingly to my cpu utilization.
ie. If there no cpu left then new thread will not be created.
I have a application which is deployed in tomcat 6 In this application I
Share
If I correctly understood your issue, I think this case is considered in Joshua Bloch’s 2nd edition of “Effective Java”:
Though I haven’t tried yet, using Executors seems to be a great idea.