-- May 2 In-Class Exercise Thread
For `s`, because shared locks can be held by multiple transactions all at once, require at least greater than 50% of the entire machines with the logical element (value of `n`) to grant a shared lock.
For `x`, because exclusive lock ensures only 1 transaction to modify the corresponding data, it is important to check with all machines.
The advantage is, unlike the primary copy locking technique, it avoids one machine currently holding the lock to undergo heavy traffic, caused by all other machines sending requests to it, which may lead to crash. The time it takes for the lock-requesting-machine to check with all other machines (especially if there are a lot of them) could be thought of as the disadvantage, however.
(
Edited: 2018-05-02)
For @BT@s@BT@, because shared locks can be held by multiple transactions all at once, require at least greater than 50% of the entire machines with the logical element (value of @BT@n@BT@) to grant a shared lock.<br />
For @BT@x@BT@, because exclusive lock ensures only 1 transaction to modify the corresponding data, it is important to check with all machines.<br />
The advantage is, unlike the primary copy locking technique, it avoids one machine currently holding the lock to undergo heavy traffic, caused by all other machines sending requests to it, which may lead to crash. The time it takes for the lock-requesting-machine to check with all other machines (especially if there are a lot of them) could be thought of as the disadvantage, however.