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

Student FinanceWeb Platform

Pocketly — Personal Finance for Students

Keep your hostel and college expenses under control. Track accounts, log spending in seconds, and stay within your monthly budget.