Compare binary locks to shared locks and exclusive locks. Why are binary locks not preferred?

Comparison of Binary to Shared Locks

The binary lock has two states of lock, i.e., locked/unlocked (0 or 1), a shared lock is a type of lock that is placed on a data item under a read-only operation, and the exclusive lock puts a data item on a read as well as write operation lock mode.

Binary locks put data items in a locked or unlocked state, whereas shared and exclusive locks differentiate the locks based on their issues. A read lock is said to be a shared lock, while a read lock is said to be exclusive.

In binary locks, only one transaction at a particular time can hold a lock, unlike in a shared lock where more than one transaction can hold a lock: Shared lock or read lock. Exclusive locks are applied on transactions that request write operation to the database.

Binary locks are simpler than shared and exclusive locks, but they cannot be applied practically in the data locking mechanism.

Why Binary Locks Are Not Preferred

With binary locks, once a data item is locked, it cannot be accessed by any other transaction until its state changes to unlocked, making concurrent access impossible. Shared locks allow more than one transaction to access a data item that is locked by a shared lock since the data is only available for a read operation. The data item is locked from access when requested for a write operation, putting it into an exclusive lock. Therefore, the binary lock is simple but not applied practically and hence not a preferred lock mechanism due to the limitation of access to a data item under binary lock.

Answer by Academic.tip's expert
An answer to this question is provided by one of our experts who specializes in technology & it. Let us know how much you liked it and give it a rating.

Cite this page

Select a citation style:

References

Academic.Tips. (2022) 'Compare binary locks to shared locks and exclusive locks. Why are binary locks not preferred'. 29 August.

Reference

Academic.Tips. (2022, August 29). Compare binary locks to shared locks and exclusive locks. Why are binary locks not preferred? https://academic.tips/question/compare-binary-locks-to-shared-locks-and-exclusive-locks-why-are-binary-locks-not-preferred/

References

Academic.Tips. 2022. "Compare binary locks to shared locks and exclusive locks. Why are binary locks not preferred?" August 29, 2022. https://academic.tips/question/compare-binary-locks-to-shared-locks-and-exclusive-locks-why-are-binary-locks-not-preferred/.

1. Academic.Tips. "Compare binary locks to shared locks and exclusive locks. Why are binary locks not preferred?" August 29, 2022. https://academic.tips/question/compare-binary-locks-to-shared-locks-and-exclusive-locks-why-are-binary-locks-not-preferred/.


Bibliography


Academic.Tips. "Compare binary locks to shared locks and exclusive locks. Why are binary locks not preferred?" August 29, 2022. https://academic.tips/question/compare-binary-locks-to-shared-locks-and-exclusive-locks-why-are-binary-locks-not-preferred/.

Work Cited

"Compare binary locks to shared locks and exclusive locks. Why are binary locks not preferred?" Academic.Tips, 29 Aug. 2022, academic.tips/question/compare-binary-locks-to-shared-locks-and-exclusive-locks-why-are-binary-locks-not-preferred/.

Copy