Solved

Java Performance singleton

Posted on 2011-03-16
2
847 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 500 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

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …

747 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now