Q. Distinguish between PCS and SCS scheduling.
Answer:
PCS (Process Contention Scope) and SCS (System Contention Scope) are two scheduling models used in thread scheduling in operating systems. They describe where the competition for CPU occurs.
| Basis | PCS (Process Contention Scope) | SCS (System Contention Scope) |
|---|---|---|
| Meaning | Threads compete with other threads of the same process for CPU time. | Threads compete with all threads in the system for CPU time. |
| Level of scheduling | User-level scheduling (handled by thread library). | Kernel-level scheduling (handled by OS kernel). |
| Competition | Only threads inside one process compete. | Threads from all processes compete. |
| Control | Managed by user-level thread library (e.g., Pthreads library). | Managed by the operating system scheduler. |
| Mapping | User threads are mapped to LWPs (Lightweight Processes) first. | Kernel schedules kernel threads directly on CPU. |
| Performance | Faster because it avoids kernel intervention. | Slightly slower due to kernel involvement but more fair system-wide. |
| Example | Thread libraries using many-to-many or many-to-one models. | One-to-one thread model used in modern systems like Linux and Windows. |
Simple Explanation
-
PCS: Threads inside a single process compete among themselves for CPU.
-
SCS: All threads in the entire system compete for CPU.
Example
Suppose a process has 5 threads:
-
In PCS, these 5 threads first compete within the process, and the thread library selects one thread to run on a kernel thread.
-
In SCS, the OS scheduler selects one thread from all processes in the system.