Solution to Critical State Problem: Progress Requirement

  • Thread starter prashantgolu
  • Start date
  • Tags
    State
In summary, the conversation discusses a solution to the critical state problem in Galwin, which involves using an algorithm that does not meet the requirement of progress. This is due to the algorithm requiring strict alteration of processes in execution of their critical state, which can lead to a situation where one process is unable to enter its critical section even though another process is in its remainder section. This issue can be addressed by using atomic operations or implementing mutexes and semaphores in the operating system.
  • #1
prashantgolu
50
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
  • #2
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.
 
  • #3
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...
 
  • #4
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:
 
  • #5
thanks a lot :)
 
  • #6

What is the critical state problem?

The critical state problem is a mathematical problem that involves finding the minimum number of moves required to reach a specific end state from a given starting state. It is commonly used in fields such as computer science, game theory, and operations research.

What is a solution to the critical state problem?

A solution to the critical state problem involves finding a sequence of moves that leads to the desired end state from the given starting state. This solution is often referred to as the optimal solution, as it requires the minimum number of moves to reach the end state.

What is the progress requirement in the critical state problem?

The progress requirement in the critical state problem refers to the condition that each move in the solution must bring the system closer to the end state. This ensures that the solution is indeed optimal and that no unnecessary moves are made.

How is the critical state problem solved?

The critical state problem can be solved using various algorithms, such as the A* search algorithm or dynamic programming. These algorithms use heuristics and systematic exploration of possible solutions to find the optimal solution to the problem.

What are the applications of the critical state problem?

The critical state problem has various applications in fields such as computer science, game theory, and operations research. It is used in solving puzzles, planning and optimization problems, and in designing efficient algorithms for various real-world problems.

Similar threads

  • Engineering and Comp Sci Homework Help
Replies
2
Views
1K
  • Programming and Computer Science
Replies
2
Views
2K
  • Programming and Computer Science
Replies
1
Views
6K
Replies
5
Views
2K
  • Engineering and Comp Sci Homework Help
Replies
4
Views
2K
  • General Math
Replies
13
Views
1K
  • Special and General Relativity
Replies
2
Views
851
Replies
1
Views
3K
  • Quantum Physics
Replies
2
Views
971
  • Introductory Physics Homework Help
Replies
2
Views
1K
Back
Top