I study the OS book[operating system concepts] written by Silberschatz recently.
At chapter 5, the book describes the concept of "Contention scope", and mentions that there are two types of contention scope. One is PTHREAD_SCOPE_PROCESS and the other is PTHREAD_SCOPE_SYSTEM.
And for PTHREAD_SCOPE_SYSTEM, the user level thread will bind to one LWP[virtual processor], and this LWP will attaches to one kernel thread.
Actually, I'm not quite understanding the concept of LWP. On the command line terminal I can type the following command:
ps -eLf
And I can see one process[PID] may have several LWP[thread IDs]. By doing some survey, I found that LWP seems simply mean thread or tasks in linux. like the following link:
How Linux handles threads and process scheduling
So I have the following two questions:
Q1 : Is LWP defined as virtual processor in linux? what source code in kernel defines it?
Q2: In the following picture, syslog has the PID [852] and has four threads. And these four LWPs will each bind one kernel thread? Or kernel will just schedule them directly?
The above picture is taken from:
http://www.softprayog.in/tutorials/ps-command-usage-examples-in-linux
Thanks in advance