1,840 views

1 Answer

Best answer
4 votes
4 votes

Lost update problem is really simple. 

Deposit (10)
A = A+10;

View Balance:
print A

Now, suppose initial balance A is 100 someone deposits 20 by calling Deposit(10) two times and then called View Balance to view the updated balance. If they are called sequentially no problem here. But suppose they are called concurrently:

Suppose in first call to Deposit, 
A = A + 10;

Here, A is read, 10 is added to it and A+10 is stored back to A. 

Similarly happens in next call to Deposit. But if the read of A in second happens before the final store to A in first call, the first call of Deposit has no effect. The update done by first Deposit is lost (when the second Deposit stores the value it will be 110 and not 120 as it has read 100 instead of 110)- and this is called Lost update problem. 

WW problem surprise



 

selected by

Related questions

0 votes
0 votes
3 answers
2
rahul sharma 5 asked Jan 7, 2017
2,271 views
W1(A),R2(A),W2(A),W2(B),W1(B)This schedule has WW conflict but not Lost update problem,Please explain why?Is it possible to have WW conflict without lost update?
1 votes
1 votes
3 answers
4
Prasanna asked Dec 4, 2015
3,825 views
What is Byte Addressable and Word Addressable means in computer Architecture ? Difference between them with examples?I also find some sources like stack overflow and wik...