midterm-sol - CMPSCI 377: Operating Systems Solution to...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
CMPSCI 377: Operating Systems Solution to Midterm: Processes, CPU Scheduling, Synchronization and Deadlocks 1. (15 pts) Short answer questions (a) (4 pts) Why do microkernel operating systems have a performanace disadvantage over those that employ monolithic kernels? Solution: OS components within a microkernal operating system use processes that communicate via messages which incur message passing overheads. This is achieved by function calls in a monolithic kernel which is much faster. (b) (6 pts) What is a system call? Draw a figure that shows the steps involved in executing a system call. Solution: A system call is the mechanism used by the application program to request service from the operating system. System calls are mostly accessed by programs via a high-level Application Program Interface (API) rather than direct system call use. (c) (5 pts) Explain the steps performed by the kernel during a context switch. Solution: In a context switch, the kernel saves the state of the first process to PCB, so that, when the scheduler gets back to the execution of the first process, it can restore this state and continue. The state 1
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
other operating system specific data that may be necessary. The kernel then loads the state of the new process from the PCB, and starts its execution. 2. (30 pts) Processes and Threads (a) (10 pts) Draw a state transition diagram showing how a process transitions from one state to another during the course of its execution. Using this figure, list the states that the following program will visit during its execution: producer() { acquire(lock); if(full(buffer)) condition_wait(cond_var, lock); buffer[next] = item; release(lock); } Assume that lock is free, full(buffer) returns true, and that another customer calls a condition signal after the condition wait has been invoked by this producer. Solution:
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 7

midterm-sol - CMPSCI 377: Operating Systems Solution to...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online