Study guides

Operating Systems

2 guides for this subject — how to prepare, what to practise, and how to know it has gone in.

A practice question

Choose an answer and it is marked, with the explanation. From Operating Systems Practice Questions: 10 Worked MCQs.

Question 11 mark

Three processes arrive at time 0 with CPU burst times P1 = 6 ms, P2 = 2 ms, and P3 = 4 ms. Under non-preemptive shortest-job-first scheduling, what is the average waiting time?

The order is P2, P3, P1. Their waiting times are 0, 2, and 6 ms, so the average is 8/3 = 2.67 ms. The 6.67 ms distractor is the average turnaround time: it includes each process's own burst, which waiting time does not.

A spoken answer, marked

An examiner's question, answered out loud and marked criterion by criterion. From Operating Systems Viva Questions: Oral Practice Guide.

Oral — Process or thread?Marked

Examiner

Compare a process and a thread, then explain what happens when a thread blocks on input.

2:363:00Mark answer
78%Process or thread? — marked78/100 · Sound, with one important omission · 2:36 spoken of 3:00
Correctness and precision17/20

You correctly identified separate process address spaces and shared resources between threads.

ImproveState explicitly that each thread has its own stack, registers and program counter.

Ordered reasoning from mechanism to consequence15/20

You explained that another thread can run when one blocks, but did not distinguish single-core from multicore execution.

ImproveSay that on a single core another runnable thread is scheduled; on multiple cores it may run concurrently on another core.

Explicit trade-offs and assumptions15/20

You mentioned cheaper thread switching and weaker isolation, but did not connect shared memory to synchronisation risk.

ImproveAdd that shared data enables communication but introduces races and the need for locks or other synchronisation.

Clear answers to follow-up questions14/20

The answer was understandable and direct, but the blocking case needed a more exact sequence.

ImproveDescribe the blocking thread leaving the runnable queue and the scheduler selecting another runnable thread.

A strong answerA process is a protected execution environment with its own virtual address space and operating-system resources, whereas a thread is an execution path within that process. Threads in one process share code, data and usually open files, but each has its own stack, registers and program counter. If one thread blocks for input, the operating system marks that thread blocked and can schedule another runnable thread; on a multicore system, another thread may run on a different core at the same time. Threads are cheaper to create and communicate through shared memory, but that sharing creates race conditions and reduces fault isolation compared with separate processes.

A marked oral answer comparing processes and threads, including the missed distinction between blocking and multicore execution.
Start studying operating systems

Yours are written from your own notes, and the free plan needs no payment details.

Guides

Studying operating systems? Build your operating systems board from your own notes — the cards, papers and lectures are written from it. Free plan: 20 cards, a paper, a lecture and a viva to try.

Start on MySummaries

Other subjects