Take the 2-minute tour ×

Since JVM creates only one process initially, does creating multiple threads in this process boost CPU performance assuming you have multiple CPU processors? This is because since all the threads inside the same process share the resources of the process. So, technically the execution is sequential?

In other words, unless you create two or more processes and associate threads to each of them, you cant avail the full benefit of parallel execution in multiple CPU processors?

share|improve this question
Do you mean CPU performance or usage? –  Chetter Hummin Apr 5 '12 at 8:55
Have you looked at stackoverflow.com/questions/1649402/… ? –  claesv Apr 5 '12 at 8:57
I mean CPU usage. –  ajithganesan Apr 5 '12 at 9:02
@claesv Yes. I did have a look at it now. Thanks. It helped. –  ajithganesan Apr 5 '12 at 9:09
add comment

1 Answer

Yes, distributing the workload over multiple threads can boost the performance of your program. It also increases the responsiveness.

However there is an increased overhead due to communication and synchronization. Also, not all algorithms are able to be parallelized.

share|improve this answer
+1: Good answer. –  Peter Lawrey Apr 5 '12 at 12:05
add comment

Your Answer


