Categories
Operating System

Peterson’s solution

Peterson’s solution:- Peterson’s solution is a software based solution to the critical section problem. Consider two processes P0 and P1. For convenience, when presenting Pi, we use Pi to denote the other process; that is, j == 1 – i. The processes share two variables: boolean flag [2] ; int turn; Initially flag [0] = […]