1,372 views
0 votes
0 votes

In case of TSL we are aware of the following instructions:

 

     1.   TSL LOCK, Ro

     2.   CMP Ro, #0

     3.   JNZ step1

 

Now, the initial value of LOCK is 0

 

If process Po comes and executes line 1 and if it gets preempted, then Ro = 0 and LOCK = 1

Now, If process P1 comes and executes line 1, then it will store the value of LOCK variable(i.e 1) in Ro and set LOCK as 1...right?

Now, suppose P1 gets preempted and Po comes back execute line 2. Now, the value of Ro is set as 1(as P1 made it to 1) and Po should not be able to enter the CS...right? 

 

So, in this way, Po and P1 both will get stuck...right? and so is there a chance of deadlock?

Please log in or register to answer this question.

Related questions

3 votes
3 votes
2 answers
1
Nils asked May 25, 2016
2,467 views
Which of the following is true/false Explain it.1) TSL solution method is deadlock free.2)TSL solution method is starvation free.3)TSL solution method process enter into...
0 votes
0 votes
1 answer
2
0 votes
0 votes
2 answers
3
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...