Implementating Mutual Exclusion using Critical Regions

Q1. Give an example, where mutual exclusion is implemented using critical regions.

Ans. Process A enters its critical region at time T1. A little later, at time T2 process B attempts to enter its critical region but fails because another process is already in its critical region and we allow only one at a time. Consequently, B is temporarily suspended until time T3 when A leaves its critical region, allowing B to enter immediately. Eventually B leaves (at T4) and we are back to the original situation with no processes in their critical region.

Mutual exclusion using critical regions

 

Leave a Reply

Your email address will not be published. Required fields are marked *