title: Clarification of process scheduling, thread scheduling, CPU scheduling in preemptive multitasking operating system
body: <p>I want to clarify process scheduling, thread scheduling concept, which sometimes even being called CPU scheduling or just scheduling as if it is synonym, due to inconsistent terminology. I mean in theoretical, conceptual perspective.</p>
  <p>Condition is preemptive multitasking operating system, which thread is the entity being scheduled for execution (ex. Windows), under multicore environment.
  Scheduling algorithm is round robin if necessary.</p>
  <p>Last time I've been taught to get authoritative sources, not wikipedia. So I've read Operating System Concepts 10th edition Abraham Silberschatz, Modern Operating Systems fourth edition Andrew S. Tanenbaum.</p>
  <p>But my question of <strong>&quot;When they say process scheduling and thread scheduling, are they same except that process scheduling unit is process and thread scheduling unit is thread?&quot;</strong> hasn't been solved. In other words, <strong>&quot;Are process scheduling and thread scheduling both task scheduling, which just scheduling unit differs?&quot;</strong></p>
  <p>I know that process scheduling is mostly &quot;written at a time, not very long ago, when threads didn't exist&quot; because someone taught me.</p>
  <p>Below is my understanding so far.</p>
  <blockquote>
  <p>On modern operating systems it is kernel-level threads—not processes—that are in fact being scheduled by the operating system. (p199, Operating System Concepts 10th edition)</p>
  </blockquote>
  <blockquote>
  <p>Many of the same issues that apply to process scheduling also apply to thread scheduling, although some are different. When the kernel manages threads, scheduling is usually done per thread, with little or no regard to which process the thread belongs. (p149, Modern Operating Systems fourth edition)</p>
  </blockquote>
  <p>Comparison in table.</p>
  <div class="s-table-container">
  <table class="s-table">
  <thead>
  <tr>
  <th>Process management</th>
  <th>Process management</th>
  </tr>
  </thead>
  <tbody>
  <tr>
  <td><strong>Process scheduling (of old days)</strong></td>
  <td><strong>Thread scheduling</strong></td>
  </tr>
  <tr>
  <td>Processes with single thread</td>
  <td>Scheduling decisions are made strictly on a thread basis, no consideration is given to what process the thread belongs to. (thread granularity) Competition for the CPU with SCS scheduling takes place among all threads in the system (System contention scope)</td>
  </tr>
  <tr>
  <td>Selecting available processes, put selected processes to ready queue (Step 1 : scheduling queue) (Long term scheduling)</td>
  <td>Not mentioned. But it seems implicitly &quot;selecting available threads, put selected threads to ready queue&quot; (step 1) (long term scheduling)</td>
  </tr>
  <tr>
  <td>Selecting processes from ready queue, allocate a CPU core each (Step 2 : CPU scheduling) (short term scheduling)</td>
  <td>Decide threads from ready queue, schedule threads onto CPU (system contention scope) (step 2, CPU scheduling) (short term scheduling)</td>
  </tr>
  <tr>
  <td>Removal and restoration of processes (swap in/swap out)(intermediate form)(medium term scheduling)</td>
  <td>Not mentioned.</td>
  </tr>
  </tbody>
  </table>
  </div>
  <p>Also, I've seen somewhere stating CPU scheduling as synonym as process scheduling or thread scheduling. However, <strong>isn't CPU scheduling subset of process scheduling or thread scheduling?</strong></p>
  <blockquote>
  <p>When a computer is multiprogrammed, it frequently has multiple processes or threads competing for the CPU at the same time. This situation occurs whenever two or more of them are simultaneously in the ready state. If only one CPU is available, a choice has to be made which process to run next. The part of the operating system that makes the choice is called <strong>the</strong> scheduler, and the algorithm it uses is called the scheduling algorithm. (p149, Modern Operating Systems fourth edition)</p>
  </blockquote>
  <p>&quot;The scheduler&quot; sounds like there is no other scheduler but one, which process scheduler. However, <strong>isn't there other schedulers like I/O scheduler?</strong></p>
  <p>Thank you for reading.</p>