Consider three concurrent processes P1, P2 and P3 as shown below, which access…

2019

Consider three concurrent processes P1, P2 and P3 as shown below, which access a shared variable D that has been initialized to 100.

The processes are executed on a uniprocessor system running a time-shared operating system. If the minimum and maximum possible values of D after the three processes have completed execution are X and Y respectively, then the value of Y – X is _____________.

Attempted by 206 students.

Show answer & explanation

Correct answer: 80

answer : 80

the minimum value will be 50 , suppose p2 reads the vaule of D and preempt , and p1 and p3 updates the value of D terminates , but for p2 still the value will 100 as it read earlier and will set the value to 50

similary the max value will be 130 .
hence =130-50 is 80

A video solution is available for this question — log in and enroll to watch it.

Explore the full course: Gate Guidance By Sanchit Sir