0

I have a basic question regarding how threads work, considering, for example, the many-to-one threads :

see a picture here

What does this imply exactly ? Does this mean that each time you are executing user-level threads, they will be mapped to one kernel thread ONLY during a system-call ? Or on the other hand, the instructions of all user-lever-thread are executed by exactly one kernel-level thread ?

Also, why can user-level thread block the whole process ?

  • 1
    This relation shows how **kernel treats** user-level threads: it treats them as single thread, and create single kernel-level thread for them. If any of user-level threads executes blocking system call, it blocks kernel-level thread, so no of user-level threads has a chance to run. There are many questions on SO about user-level threads. E.g. [this one](http://stackoverflow.com/questions/14791278/threads-why-must-all-user-threads-be-mapped-to-a-kernel-thread). – Tsyvarev Feb 09 '16 at 09:25
  • Thank you, that solved my problem! – Alex Simm Feb 09 '16 at 13:51
  • Can I just ask you another question ? What executes the system call in the kernel ? Kernel threads ? – Alex Simm Feb 09 '16 at 13:53
  • 1
    Everything within kernel is executed as part of kernel threads. System calls are not exception from this rule. – Tsyvarev Feb 09 '16 at 14:15

0 Answers0