Back to the 2023 paper

Module 3: Inter-process Communication

20238m

Discuss critical section problem. Illustrate the classic software-based solution to this problem known as Peterson's solution.

Worked SolutionAI Assisted

Critical Section & Peterson

Critical section needs mutual exclusion, progress, bounded waiting. Peterson for 2 processes: shared flag[2], turn. Pi: flag[i]=true; turn=j; while(flag[j] && turn==j) wait; CS; flag[i]=false; remainder. Proves mutual exclusion.

Similar questions

Free AppAndroid App

Coursify Android App

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