554 views

1 Answer

Best answer
3 3 votes

i) Progress

P0 executes flag[0] = true.

context switch occurs.

P1 executes flag[1] = true.

Now both the processes will be executing the while loop indefinitely.

Let's check the definition of Progress

 If no process is executing in its critical section and some processes wish to enter their critical sections, then only those processes that are not executing in their remainder sections can participate in deciding which will enter its critical section next, and this selection cannot be postponed indefinitely

Here, no processes is executing in the critical section and P0, P1 want to enter the CS, but none can enter.
Hence Progress Fails.

ii) Bounded Waiting

There exists a bound, or limit, on the number of times that other processes are allowed to enter their critical sections after a process has made a request to enter its critical section and before that request is granted.

Let us suppose, process P0 is in it's critical section

context switch occurs

P1 sets flag[1] = true and enters the while() loop.

Now, when P0 completes the execution, it sets flag[0] = false, which leads to the process P1 entering into it's critical section.

Hence Bounded Waiting is Satisfied.

• selected by
Position:
Show:

Related questions

3 3 votes
4 4 answers
2.2k
2.2k views
agoh asked Dec 11, 2016
2,170 views
My doubt is as follows: If deadlock is there, processes will be busy waiting in wait loop. So, decision on which process enters C.S. is not made in finite time. Hence, is...
1 1 vote
0 0 answers
620
620 views
Raj Singh 1 asked Jan 11, 2019
620 views
I was going through this question;The link A-R is instantaneous , but the R->B link transmits only 1 packet each second , one at a time . Assume A sends to B using slidin...
0 0 votes
0 0 answers
470
470 views
Aboveallplayer asked Jan 18, 2016
470 views
i am unable to understand the concept of progress and bounded waiting after many reads of galvin.... i knw the basic but how to say looking at a code that progress is sat...
1 1 vote
1 1 answer
819
819 views
GateAspirant999 asked Jul 21, 2016
819 views
Consider the atomic exchange instruction defined as follows:void exchange (int *a, int *b) { int temp; temp = *b; *b = *a; *a = temp; }Now consider the soluti...