0

A LWP is a data structure placed between user thread and kernel thread, and appears as a virtual processor to user thread library. So, the minimum number of LWP required in many to many model of threading is the number of concurrent blocking system calls.

Please explain why is it so?

slm
  • 369,824
  • "A LWP is a data structure placed between user thread and kernel thread": This all is confusing from the start. –  Oct 28 '19 at 06:10

1 Answers1

1

A Lightweight Process is (in Unix and Unix-like) a process that runs in user space over a single kernel thread and shares its address space and resources with other LWPs of the same user process.

A system call is an invocation of kernel functionality from user space. When a user process performs a system call, the call is handled by the LWP associated with the user process/thread and gets blocked while the call is handled down in the kernel (through the kernel thread associated with the LWP) and when the call is solved, the kernel thread and LWP are free again.

That is why the minimum number of LWPs required in a many to many threading model is the amount of concurrent blocking system calls, because blocking system calls and LWPs are 1:1 related (The LWP cannot do any other task when engaged by a blocking system call from the user thread)

slm
  • 369,824