Solution to Critical State Problem: Progress Requirement

  • Thread starter Thread starter prashantgolu
  • Start date Start date
  • Tags Tags
    State
AI Thread Summary
The discussed algorithm fails to meet the "progress" condition in the critical state problem, as it requires strict alternation between processes. Specifically, if process p1 is ready to enter its critical section while turn is set to 0 (indicating p0's turn), p1 cannot proceed even if p0 is in its remainder section. This leads to a scenario where p1 could be indefinitely blocked if p0 does not wish to enter its critical section, violating the progress requirement. The conversation highlights the need for atomic operations or additional mechanisms like flags to ensure proper synchronization. Overall, the algorithm's design limits its effectiveness in managing concurrent processes.
prashantgolu
Messages
50
Reaction score
0
i read this as a solution to critical state problem in galwin

repeat
while turn!= i do no-op;
critical section
turn := j;
remainder section
until false;


now this algo does not meet the "progress" conditiion...
the book states the reason as...this requires strict alteration of processed in execution of their critical state
for ex...if turn =0 and p1 is ready to enter its critical section,it cannot do so...even though p0 maybe in its remainder section...

how can p1 be in its remainder section and turn still be 0...

how does this algo not meet the reqirement of progress?
 
Technology news on Phys.org
prashantgolu said:
i read this as a solution to critical state problem in galwin

repeat
while turn!= i do no-op;
critical section
turn := j;
remainder section
until false;
As stated here, this doesn't make much sense. Is this just a part of an algorithm and you haven't shown us the rest? We don't know the value of i, so can't tell whether turn != i is true or false.
prashantgolu said:
now this algo does not meet the "progress" conditiion...
the book states the reason as...this requires strict alteration of processed in execution of their critical state
for ex...if turn =0 and p1 is ready to enter its critical section,it cannot do so...even though p0 maybe in its remainder section...

how can p1 be in its remainder section and turn still be 0...

how does this algo not meet the reqirement of progress?
What are p0 and p1? They aren't mentioned in the algorithm you showed.
 
sorry...my fault...turn=0 initaially...and p0 and p1 are two processes...this algorithm is for 2 processes only...so turn can be 0 or 1...
 
Ya, it is true that the algorithm does not satisfy the condition of progress...

Imagine a case when p1 has entered its critical section. After executing, it turns the value of turn to 0 and exits. But the process p0 does not want to enter its critical section. So the value of turn would be set to 0 for ever. Even though if process p1 wants to enter its critical section again, it cannot do so, until process p0 wishes to enter its critical section.
Hence the condition of progress is not satisfied.

I hope I was able to explain you. Do let me know...:approve:
 
thanks a lot :)
 
Dear Peeps I have posted a few questions about programing on this sectio of the PF forum. I want to ask you veterans how you folks learn program in assembly and about computer architecture for the x86 family. In addition to finish learning C, I am also reading the book From bits to Gates to C and Beyond. In the book, it uses the mini LC3 assembly language. I also have books on assembly programming and computer architecture. The few famous ones i have are Computer Organization and...
I have a quick questions. I am going through a book on C programming on my own. Afterwards, I plan to go through something call data structures and algorithms on my own also in C. I also need to learn C++, Matlab and for personal interest Haskell. For the two topic of data structures and algorithms, I understand there are standard ones across all programming languages. After learning it through C, what would be the biggest issue when trying to implement the same data...
Back
Top