Reference no: EM132361585
Consider the following two data fields V1 and V2. The initial values of A and B are Displayed inside the box assigned for V1 and V2
V1: 100
V2: 140
Order of Processing of two Programs A & B - both are allowed to access to V1 and V2 For potential update, and at this moment the database system does not support any locking Mechanism.
1. Program B reads value from V1 into its local variable BV1
2. Program A reads value from V2 into its local variable AV2
3. Program A reads value from V1 into its local variable AV1
4. Program B subtracts 50 from BV1 and write its content back to V1
5. Program A adds 40 to AV2 and write its content back to V2
6. Program B reads value from V2 into its local variable BV2
7. Program B subtracts 60 from its local variable BV2
8. Program A add 20 from its local variable AV1
9. Program A writes the content of AV1 back to V1
10. Program B writes the content of BV2 back to V2
a) What is the final value in V1 and V2?
V1:
V2:
b) If the system does support some locking mechanism, then what shall be the final content of V1 and V2?
V1:
V2: