title: Not understand the concept of LWP in liunx kernel
body: <p>I study the OS book[operating system concepts] written by Silberschatz recently.</p>
  
  <p>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.</p>
  
  <p>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. </p>
  
  <p>Actually, I'm not quite understanding the concept of LWP. 
  On the command line terminal I can type the following command:</p>
  
  <pre><code>ps -eLf
  </code></pre>
  
  <p>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:</p>
  
  <p><a href="https://stackoverflow.com/questions/8463741/how-linux-handles-threads-and-process-scheduling">How Linux handles threads and process scheduling</a></p>
  
  <p>So I have the following two questions:</p>
  
  <p><strong>Q1 :</strong>
  Is LWP defined as virtual processor in linux? what source code in kernel defines it?</p>
  
  <p><strong>Q2:</strong>
  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?</p>
  
  <p><a href="https://i.stack.imgur.com/m8NLD.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/m8NLD.jpg" alt="enter image description here"></a> </p>
  
  <p>The above picture is taken from:</p>
  
  <p><a href="http://www.softprayog.in/tutorials/ps-command-usage-examples-in-linux" rel="nofollow noreferrer">http://www.softprayog.in/tutorials/ps-command-usage-examples-in-linux</a> </p>
  
  <p>Thanks in advance</p>