2

In my CPU I know I have 8 cores and 16 threads (2 threads by core).

But when I create threads through programming (for example in c++) I can create more than 100,000 threads.

Then what's the difference between those two kinds of threads?

1
  • 1
    Your CPU can task switch so that your 100,000 logical threads run in 16 actual CPU threads. Commented Oct 31, 2020 at 11:07

1 Answer 1

5

A C++ thread is just a sequence of instructions and your native thread(cpu thread) is something which can run a C++ thread.

  • C++ thread: something to run
  • Hardware thread: where it can run
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.