0
$\begingroup$

I am referencing the Book Fundamentals of Computer Algorithms" by Ellis Horowitz et al.

At the part which they talk about multi-threading models, user-level and kernel-level thread are introduced.

And at the scheduling chapter, under multi-core processors, they talk about software threads and hardware threads.

Even though both sections are titled 'multithreading', one deals with how user-threads are mapped to kernel threads and the other deals with hyperthreading. (correct me if I am wrong)

I just want to know whether they are talking about the same terms. If not, will you clarify what is the difference between User-level threads vs software threads?

Thank you.

$\endgroup$
0
$\begingroup$

Kernel threads and user threads are both software threads. This is only terminology, but I think that hardware threads in your book are the actual CPU cores including hyperthreading threads that the CPU can run at once. So a hardware thread is not instructions or an actual thread, it is simply the threads that the CPU supports. For example, if the CPU has 4 cores and each core uses hyperthreading to have 2 virtual threads each, then you would have 8 hardware threads available for software threads to run.

Kernel threads and user threads are separated by a permission bit in the page tables. Having a thread with a permission of 0 (kernel thread) doesn't make the thread a hardware thread. It is simply a software thread running in kernel mode.

$\endgroup$
1
  • $\begingroup$ Yea, I think your answer is correct. If you are sure about the answer then I will mark it as answered. $\endgroup$ Jan 20 at 15:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.