Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Java Performance singleton

Posted on 2011-03-16
2
Medium Priority
?
859 Views
Last Modified: 2012-05-11
I have a Java multi thread application running in a multi core CPU linux box. Ideally, multi thread would distribute load to different core of CPU. What about if I have singleton, concurrentHashmap, atomicInteger in the application, Would that influence performance? So the load would be decreased since the speed would not that fast as totally concurrently?

0
Comment
Question by:JianJunShen
2 Comments
 
LVL 2

Accepted Solution

by:
sdern earned 1500 total points
ID: 35160946
Are you saying your using a concurrent Hashmap with the singleton design pattern? I dont think you'd need to worry about synchronization when accessing the hashmap because it should be initialized and then would be static. The only synchronization that you would have to worry about is the atomicInteger. The operating system would then handle the work load distribution for the threads.
0
 

Author Closing Comment

by:JianJunShen
ID: 35161920
actually atomicinteger is also fast when there are not too many threads.
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

After being asked a question last year, I went into one of my moods where I did some research and code just for the fun and learning of it all.  Subsequently, from this journey, I put together this article on "Range Searching Using Visual Basic.NET …
By the end of 1980s, object oriented programming using languages like C++, Simula69 and ObjectPascal gained momentum. It looked like programmers finally found the perfect language. C++ successfully combined the object oriented principles of Simula w…
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
Suggested Courses

876 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question