384 views

1 Answer

0 votes
0 votes
Try different possibilities of running these two threads and primpt processes to get the desired result.

For example 900 as outcome is possible when T1 reads A=1000, then primpted and T2 reads A=1000. Primpt T2 run T1 3 times and make A = 1300. Now run T2 for 2 times, Since T2 has read A =1000 and not 1300 so after 2 iterations it will make A=900.

Similary you can try for other possibilities also.

Related questions

2 votes
2 votes
1 answer
1
sampad asked Dec 31, 2015
579 views
int x=0,y=0;par beginbeginx=1;y=y+x;endbeginy=2;x=x+3;endpar endwhat are the possible values of x and y after completion of the program?a. x=1 ,y=2 b.x=1,y=3c.x=4,y=6
1 votes
1 votes
2 answers
2
radha gogia asked Nov 26, 2015
1,863 views
In this question If I consider first total no of outcomes as 6^5 , then I divided it be 6C5 *5! since there are 5 similar dices so the outcome (1 2 3 4 5 ) will be simil...
0 votes
0 votes
1 answer
3
ajayraho asked Oct 23, 2022
911 views
What is the significance of infinite loop that is written in every example of process synchronisation? What would happen if there wasn't any infinite loop?
3 votes
3 votes
0 answers
4
iarnav asked Sep 28, 2018
770 views
Any implementation of a critical section requires the use of an indivisible machine- instruction ,such as test-and-set?Is the above statement True or False?