1,555 views
0 votes
0 votes
how is deadlock and starvation possible in test and set lock solution of M.E??

1 Answer

1 votes
1 votes

I think deadlock is not possible but starvation is possible.

Lock variable is independent. If a process is in CS and set the lock to 1, all the other process who want to go to CS will stuck at while loop, and because there is no FIFO the process which was earlier in CS will come back, then it can go again and agian to CS such that all other will starve.

Related questions

0 votes
0 votes
0 answers
2
Akriti sood asked Dec 5, 2016
702 views
Consider the following Pseudo code:(Assume initially turn =1)is starvation possible here??
5 votes
5 votes
4 answers
3
Prateek Dwivedi asked Jun 27, 2015
31,773 views
This is a question from Operating System concepts by Silberschatz, Gagne and Galvin. On very first go I could make that in such a situation deadlock can never occur. But ...
0 votes
0 votes
0 answers
4
Raj Singh 1 asked Jan 1, 2019
1,430 views
Many problems on gateoverflow asks whether the given code satisfies progress requirement of the solution for the critical section problem. Most of these code contain mult...