As per the given question,
"T_1" transfers $500 from A to B and "T_2" transfers 30% of the balance from A to B
a) "T_1" followed by "T_2"
Transaction "T_1"
read(A)
A:=A-500
write (A)
read(B)
B:=B+500
write(B)
Transaction "T_2"
read(A)
temp:=A*0.3
A:=A-temp
write(A)
read(B)
B:=B+temp
write(B)
b) Serial schedule "T_2" followed by "T_1"
Transaction ("T_1")
read(A)
A:=A-500
write(A)
Transaction "(T_2)" :
read(A)
temp:=A*0.3
A:=A-temp
write(A)
Transaction ("T_1")
read(B)
B:=B+500
write(B)
Transaction "(T_2)" :
read(B)
B:=B+temp
write(B)
c) The main advantages of serial scheduling, it gives the guarantee for data consistency.
It have the high average waiting time, low response time and low throughput could be possible.
Comments
Leave a comment