

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!


The mechanisms, the calculations and the concurrency questions exams ask Computer Science | Undergraduate (Level 5) | December 2026
WHAT IS INSIDE
A process is a program in execution with its own address space, and a thread is a schedulable execution stream sharing that address space with its siblings. The trade-off is exactly the sharing: threads communicate cheaply through shared memory but need synchronisation, while processes are isolated and pay for communication through IPC. Context switching saves and restores register state and, on a switch between processes, changes the address space, which is why a thread switch is cheaper than a process switch.
The process state model - new, ready, running, waiting, terminated - is what an exam traces through a fork, a blocking read and a signal. System calls are the controlled entry into kernel mode: the trap switches privilege level, the kernel validates arguments and returns a result, and the cost of that transition is what makes a tight read loop slower than buffered I/O. fork duplicates the address space lazily by copy-on-write and returns twice, which is why the child must check the returned value.
Scheduling questions are marked on the numbers. FCFS is simple and suffers the convoy effect; SJF minimises average waiting time but needs burst prediction and starves long jobs; round robin bounds response time with a quantum that trades context-switch overhead against responsiveness; priority and multilevel feedback queue approximate SJF without knowing the future by penalising jobs that use the CPU heavily.
Always compute the same four measures so answers are comparable: waiting time (time in the ready queue), turnaround (completion minus arrival), response (first dispatch minus arrival) and throughput. Then argue with the numbers: SJF's lower average waiting time is paid for by variance, and a real-time system cares about the deadline miss rate rather than the average, which is why EDF and rate-monotonic scheduling appear in embedded cases.
Operating Systems: Processes, Scheduling, Memory and File Systems
A race condition arises when the result depends on interleaving, and the critical section requirements are mutual exclusion, progress and bounded waiting. Spinlocks busy-wait and suit short critical sections on multicore; semaphores block and suit longer ones; a monitor makes the locking implicit with condition variables. The classic bugs are worth naming: a signal before wait is lost, and two condition variables with one lock produce the wrong wake-up.
Deadlock needs four conditions together - mutual exclusion, hold and wait, no preemption and circular wait
Paging removes external fragmentation by mapping fixed-size pages to frames through a page table; the TLB caches translations, and the cost of a miss is the reason locality matters. Demand paging brings pages in on fault, and the page replacement choice decides the fault rate: FIFO suffers Belady's anomaly , optimal is a bound not an implementation, and LRU approximates it with a clock algorithm.
The working set is the set of pages a process needs over a window, and thrashing happens when the sum of working sets exceeds physical memory, so the system spends its time faulting. Adding memory or reducing multiprogramming are the real fixes; a local replacement policy only contains the damage. File systems add allocation (contiguous, linked, indexed), the inode as the metadata record, directory structures and the cached buffer that hides disk latency, with journaling buying crash consistency at the cost of extra writes.
Numerical questions in this module are decided by the trace: draw the Gantt chart or the page table, state the formula once, then substitute. An answer with the right number and no working loses the method marks.