Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

WorkManager vs ExecutorService

 
manu chaox
Ranch Hand
Posts: 110
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have tried to use the ExecutorService pool to run more download threads on weblogic application server 11 for my business application. It works. But I am interested in if it is good idea. I have a bit bad feeling that I should use Work Manager.

Is it good idea to use the ExecutorService or should I use the Work Manager from commonj and why ?

Thank you for any reply
 
anandraj tadkal
Ranch Hand
Posts: 98
Oracle Redhat
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The WorkManager feature in WebLogic Server is dynamic in nature, based on the number of incoming requests the thread pool size automatically re-sizes to maximize the throughput.

The WorkManager monitors throughput over time and based on history, determines whether to adjust the thread count. For example, if historical throughput statistics indicate that a higher thread count increased throughput, WebLogic increases the thread count. Similarly, if statistics indicate that fewer threads did not reduce throughput, WebLogic decreases the same.

Comparatively ExecutorService might yield a fixed sized pool. In that case spawning and closing of the threads has to be taken care by the code if the application server does not provide this feature out of the box.

You can follow the below link for a closer understanding of WorkManagers.

http://weblogic-wonders.com/weblogic/2010/11/21/understanding-the-work-managers/

Cheers,
Anandraj
http://weblogic-wonders.com
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic