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

Free AppAndroid App

Coursify Android App

Generate AI courses, take quick quizzes between classes, and master complex engineering concepts on the go.