HOME       >>       Programming

Java Multithreading Issues


longer

So we have a web based application running on JBoss on several clustered servers. The front end of the application is using jms to communicate with the middleware MDB, which communicates with other backend application servers. The application runs well when only a few requests are submited. However, when requests boost to couple thousands, the app starts to crash. The log files shows a concurrency issue with the ThreadPoolExecutor. When we set the core size pool to one the issue was solved. Looks like we have concurrent issue of multiple threads accessing same resource simultaneously. We have to look into it for a better solution. Maybe synchronizing the method that accesses the same resource will be a better solution. Any suggestions?


xico

So we have a web based application running on JBoss on several clustered servers. The front end of the application is using jms to communicate with the middleware MDB, which communicates with other backend application servers. The application runs well when only a few requests are submited. However, when requests boost to couple thousands, the app starts to crash. The log files shows a concurrency issue with the ThreadPoolExecutor. When we set the core size pool to one the issue was solved. Looks like we have concurrent issue of multiple threads accessing same resource simultaneously. We have to look into it for a better solution. Maybe synchronizing the method that accesses the same resource will be a better solution. Any suggestions?



Hello,

Synchronizing methods is the simplest way to solve this problem. But if your system performs many I / O operations is better you use the class SynchronousQueue.
Check out this link SynchronousQueue to use a LIFO for waitingTakes and see if it´s what you are expecting.

Best Regards.

longer

Hello,
Synchronizing methods is the simplest way to solve this problem. But if your system performs many I / O operations is better you use the class SynchronousQueue.
Check out this link SynchronousQueue to use a LIFO for waitingTakes and see if it´s what you are expecting.

Best Regards.


This is pretty good option. We don't have too many I/O operations in the app that's why we decided to use LinkedBlockingQueue<Runnable>. Maybe we should try synchronization statement and SynchronousQueue to see the performance difference. Thanks for your suggestion.


VIEW DESKTOP VERSION REGISTERGET FREE HOSTING

Xisto.com offers Free Web Hosting to its Members for their participation in this Community. We moderate all content posted here but we cannot warrant full correctness of all content. While using this site, you agree to have read and accepted our terms of use, cookie and privacy policy. Copyright 2001-2019 by Xisto Corporation. All Rights Reserved.