Back to the 2019 paper

Module 3: Inter-process Communication

201914m

(a) Define semaphore. Give a scheme for implementation of semaphore primitives.

(b) What do you mean by critical section problem? What is the solution to the critical section problem?

Worked SolutionAI Assisted

(a) Semaphore & Primitives

Integer variable with atomic wait(S)/signal(V). Binary (0/1) vs counting. wait: while s≤0 wait, s-- ; signal: s++ and wake. Implementation via blocking queue, disable interrupts for atomicity.

(b) Critical Section

Segment accessing shared data. Requirements as before; solutions: mutex, semaphore (wait before CS, signal after), monitors.

Similar questions

Official AppAndroid App

PYQDeck for Android

Solve BEU previous-year exam papers anywhere, anytime. Fast search, offline paper viewing, and step-by-step solutions designed specifically for your phone.