949 views
0 votes
0 votes
Is Bounded waiting condition can violate when there are only 2 Processes ??

Plz justify ur ans With reference or PsudoCode. Thanks

1 Answer

0 votes
0 votes
Yes; Bounded Waiting Can be violated with 2 processes.

#Psudocode

/* i is this process; j is the other process */

while (true)

{

   while (turn != i); /* spin until it’s my turn */      <<< critical section >>>

   turn = j;

<<< code outside critical section >>>

}

Here Only Process i Get acess to CS repetadely but process j never gets CS (though it may get CPU time).

So No bounded Waiting for Process j.

Related questions

0 votes
0 votes
2 answers
2
shivajikobardan asked Jul 22, 2023
800 views
Sorry if this is a stupid question. But it really intrigued me. Same resources at different algorithms are telling different ways to test these stuffs.Here's an algorith...