Question bank › IB Computer Science › A1 Computer fundamentals

Operating systems, scheduling, polling and interrupts

Answer on paper first, then reveal the mark scheme one mark at a time.

1Core4 marks

A games developer writes a program that saves files and plays sound. The program never refers to the specific hard drive model or sound card in the computer it runs on.

(a) Explain how the operating system makes this possible. [2]

(b) Identify the function of the operating system that is being performed in each of the following situations.

(i) A user is refused access to a folder owned by another user. [1]

(ii) A school network records how many pages each student prints so that they can be charged. [1]

2StandardHL only4 marks

A single-core laptop is running a web browser, a music player and a word processor at the same time. The user also sends two documents to the same printer from different applications within one second of each other.

(a) Explain how the operating system allows the three applications to appear to run simultaneously on one core. [2]

(b) Explain how the operating system prevents resource contention when both applications try to use the printer. [2]

3Standard4 marks

Four processes arrive at a CPU that uses first-come first-served (FCFS) scheduling.

ProcessArrival time (ms)Burst time (ms)
P108
P214
P322
P431

(a) Calculate the average waiting time for the four processes. Show your working. [2]

(b) Explain why FCFS gives a poor average waiting time for this set of processes. [2]

Stuck on Operating systems, scheduling, polling and interrupts?

Get it sorted in a free 30-minute session

We work through your weakest questions on this topic on Zoom. I reply the same day.

4Hard6 marks

Four processes, A, B, C and D, all arrive at time 0 ms in the order A, B, C, D. Their burst times are A = 7 ms, B = 4 ms, C = 2 ms and D = 5 ms. The operating system uses round robin scheduling with a time quantum of 3 ms. Ignore the time taken to switch between processes. The start of the Gantt chart is shown.

(a) Complete the Gantt chart from 6 ms to 18 ms, showing which process runs in each interval. [3]

(b) Calculate the average turnaround time of the four processes. [2]

(c) State the effect on the schedule if the time quantum were increased to 10 ms. [1]

ABto be completed03618Time (ms)Gantt chart, round robin, quantum = 3 ms
5Standard4 marks

A single-core CPU uses non-preemptive priority scheduling. A lower number means a higher priority.

ProcessArrival time (ms)Burst time (ms)Priority
W053
X131
Y244
Z322

(a) State the order in which the processes are executed. [1]

(b) Calculate the waiting time of process Y. [1]

(c) Explain one problem that could affect a low-priority process in a busy system using priority scheduling, and how the operating system could reduce it. [2]

6Hard4 marks

A school server runs three types of process: interactive processes from students using the online learning platform, system processes such as the antivirus scanner, and overnight batch jobs that produce reports.

The technician is deciding between a single round robin queue and a multilevel queue.

(a) Describe how a multilevel queue scheduler would handle these processes. [2]

(b) Compare the suitability of the two approaches for this server. [2]

7Standard4 marks

A user presses a key while the CPU is running a spreadsheet program. The keyboard controller raises an interrupt.

Describe the sequence of steps taken from the moment the interrupt signal is received to the moment the spreadsheet program continues. [4]

8Hard7 marks

A network card on a server running at 2 GHz (2 × 109 clock cycles per second) can be serviced by polling or by interrupts.

  • Polling: the CPU polls the card 50 000 times per second; each poll uses 400 clock cycles.
  • Interrupts: each arriving packet causes one interrupt; handling one interrupt (including saving and restoring state) uses 2 500 clock cycles.

(a) Calculate the percentage of CPU time used by polling. [2]

(b) Calculate the percentage of CPU time used by interrupts when 2 000 packets arrive per second. [1]

(c) Determine the packet arrival rate above which interrupts would use more CPU time than polling. [2]

(d) Using your answers, explain why some network drivers switch from interrupts to polling during periods of very heavy traffic. [2]

9Stretch6 marks

Two embedded systems are being designed.

System 1: a battery-powered soil-moisture sensor in a field that reports a change in moisture level roughly twice a day and must run for two years without a battery change.

System 2: an airbag controller in a car that must respond to a crash sensor within a fixed, guaranteed time of 2 ms. The software is simple and the system runs from the car's power supply.

Evaluate the use of polling and interrupts for each system. [6]

10HardHL only6 marks

The diagram shows three processes, P1, P2 and P3, and three resources, R1, R2 and R3, managed by an operating system. Each resource can be used by only one process at a time.

(a) Identify which processes are deadlocked. Justify your answer using the diagram. [2]

(b) Outline two of the conditions that must be present for this deadlock to occur. [2]

(c) Describe one way in which the operating system could recover from this deadlock. [2]

P1 P2 P3 R1 printer R2 scanner R3 file resource held by process requests

Stuck on this topic?

Book a free 30-minute session on WhatsApp and we'll find exactly which step is costing you the marks. Or build a timed paper on it.

Free 30-minute session