1

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?

3
  • Do you mean CPU performance or usage? Commented Apr 5, 2012 at 8:55
  • 3
    Have you looked at stackoverflow.com/questions/1649402/… ? Commented Apr 5, 2012 at 8:57
  • @claesv Yes. I did have a look at it now. Thanks. It helped. Commented Apr 5, 2012 at 9:09

1 Answer 1

2

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.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.