1

This question is regarding Multithreading in Java.

Multithreading is for the maximum utilisation of cpu. According to what I read, only one thread can be executed at a time. I believe that it it true for single processor system. Number of threads that can be executed simultaneously depends on what factors??

For Instance, If I am using 4 core processor, how many threads can be run concurrently??

Thanks in Advance.

2
  • possible duplicate of Maximum number of threads than can run concurrently in java on a CPU Commented Apr 22, 2015 at 10:45
  • According to what I read... I believe that it it true for single processor Your belief is correct: What you read is out-of-date. It was true when a computer had only one CPU, but today, even a smart phone can have more than one CPU, and a mainframe can have more than a hundred CPUs. The max number of concurrent threads is equal to the number of CPUs. (Note: a hyperthreaded core can count as more than one virtual CPU). Commented Apr 22, 2015 at 13:43

1 Answer 1

1

For a 4-core processor 4 threads, or 8 if there's HyperThreading in the processor.

HyperThreading allows a core that's not running at 100% capacity to run 2 threads on a single core.

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.