324 views
0 votes
0 votes

https://gradeup.co/synchronization-i-aa88478c-bb42-11e5-a5c3-3a0910926b62

here in this artical the algorithm 2 which is flag solution for Critical solution problem satisfies ME but it dosnt satisfy progree how? i think instead of progress it dosnt satisfy bounded wait but every where i have searched they are saying progress only. please help to identify

1 Answer

Best answer
3 votes
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

Related questions

3 votes
3 votes
4 answers
1
agoh asked Dec 11, 2016
1,142 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...
0 votes
0 votes
0 answers
3
Aboveallplayer asked Jan 18, 2016
302 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...