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)

  1. Define a process.
  2. Name the states of a process.
  3. What is a PCB?
  4. What is a context switch?
  5. Distinguish the long-term and short-term schedulers.
  6. Define a thread.
  7. Define turnaround time and waiting time.
  8. What is the convoy effect?
  9. What is a time quantum?
  10. Distinguish preemptive and non-preemptive scheduling.

Medium Answer Questions (5 marks each)

  1. Explain the process state diagram.
  2. Explain the contents of a PCB.
  3. Explain the benefits and types of threads.
  4. Explain the criteria of CPU scheduling.
  5. Compare FCFS and SJF with an example.
  6. Explain Round Robin scheduling with an example.

Long Answer Questions (15 marks each)

  1. Explain the process concept, process states, transitions and the PCB.
  2. Explain process scheduling, queues and schedulers, and threads with multithreading models.
  3. Explain the objectives of CPU scheduling and preemptive and non-preemptive scheduling.
  4. 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