Unit summary
- A process is a program in execution, moving among the new, ready, running, waiting and terminated states.
- The PCB stores all the information about a process, and a context switch saves one PCB and loads another.
- Long-term, short-term and medium-term schedulers manage the job, ready and device queues.
- Threads share their process's code and data, giving responsiveness, economy, sharing and scalability.
- CPU scheduling aims to maximise utilisation and throughput and to minimise turnaround, waiting and response times.
- FCFS is simple but suffers the convoy effect, SJF minimises average waiting, and Round Robin gives good response.
- Scheduling algorithms are evaluated by deterministic modelling, queueing models, simulation and implementation.
Glossary
| Term | Meaning |
|---|---|
| Context switch | Saving one process and loading another. |
| CPU burst | A period of computation. |
| Dispatcher | Gives the CPU to the chosen process. |
| FCFS | First-come, first-served scheduling. |
| Kernel thread | A thread managed by the OS. |
| Long-term scheduler | Chooses jobs to load into memory. |
| Multithreading | Several threads in one process. |
| PCB | The record of a process kept by the OS. |
| Preemptive | Scheduling that can take the CPU away. |
| Process | A program in execution. |
| Process state | The current activity of a process. |
| Ready queue | Processes waiting for the CPU. |
| Round Robin | Time-sliced preemptive scheduling. |
| Short-term scheduler | Chooses the next process to run. |
| SJF | Shortest job first scheduling. |
| Starvation | A process waiting indefinitely. |
| Thread | A unit of execution within a process. |
| Time quantum | The time slice in Round Robin. |
| Turnaround time | Completion time minus arrival time. |
| Waiting time | Turnaround time minus burst time. |
Question bank
Short Answer Questions (2 marks each)
- Define a process.
- Name the states of a process.
- What is a PCB?
- What is a context switch?
- Distinguish the long-term and short-term schedulers.
- Define a thread.
- Define turnaround time and waiting time.
- What is the convoy effect?
- What is a time quantum?
- Distinguish preemptive and non-preemptive scheduling.
Medium Answer Questions (5 marks each)
- Explain the process state diagram.
- Explain the contents of a PCB.
- Explain the benefits and types of threads.
- Explain the criteria of CPU scheduling.
- Compare FCFS and SJF with an example.
- Explain Round Robin scheduling with an example.
Long Answer Questions (15 marks each)
- Explain the process concept, process states, transitions and the PCB.
- Explain process scheduling, queues and schedulers, and threads with multithreading models.
- Explain the objectives of CPU scheduling and preemptive and non-preemptive scheduling.
- Explain FCFS, SJF and Round Robin scheduling with examples, and the evaluation of scheduling algorithms.
Sources
- Official BCA syllabus Operating Systems, course code 25BCA402DS03, Unit II
