Techniques for controlling use of locks
US-2015220372-A1 · Aug 6, 2015 · US
US10078653B2 · US · B2
| Field | Value |
|---|---|
| Publication number | US-10078653-B2 |
| Application number | US-201514741247-A |
| Country | US |
| Kind code | B2 |
| Filing date | Jun 16, 2015 |
| Priority date | Jun 16, 2015 |
| Publication date | Sep 18, 2018 |
| Grant date | Sep 18, 2018 |
A practical reading order for non-experts. Skip the full description unless you need deep technical detail.
What the patent document calls the invention.
A short plain-language summary of the technical disclosure.
Who owns or filed the patent and who is credited as inventor.
Filing, priority, publication, and grant dates set the timeline.
The legal scope of protection — read this for what is actually claimed.
Technology tags used to group this patent with similar filings.
Prior art links and similar publications in this corpus.
Official abstract text for this publication.
In one embodiment, a set of lock and unlock instructions in a read phase of a computer-readable program is replaced with a first set of tracking instructions, wherein the first set of tracking instructions track a set of locked objects identifying objects that would have been locked by executing the set of lock and unlock instructions. A second set of tracking instructions is inserted into the read phase of the computer-readable program, wherein the second set of tracking instructions track a set of read objects indicating versions of objects that are read. Validation instructions are inserted into the computer-readable program, wherein the validation instructions validate that the versions of objects in the set of read objects have not changed since they were last read and lock the set of locked objects that would have been locked upon completing execution of the set of lock and unlock instructions. Update instructions are added to an update phase of the computer-readable program, where the update instructions increment a current version of an object each time a value of the object is updated or a lock of the object is released.
Opening claim text (preview).
What is claimed is: 1. A method, comprising: replacing, by a processor, a set of lock and unlock instructions in a read phase of source code with a first set of tracking instructions, wherein the first set of tracking instructions track a set of locked objects identifying objects that would have been locked by executing the set of lock and unlock instructions; inserting, by a processor, a second set of tracking instructions into the read phase of the source code, wherein the second set of tracking instructions track a set of read objects indicating versions of objects that are read; inserting, by a processor, validation instructions into the source code, wherein the validation instructions lock objects in the set of locked objects and validate that the versions of objects in the set of read objects have not changed since they were last read; and adding, by a processor, update instructions to an update phase of the source code, wherein the update instructions increment a current version of an object each time a value of the object is updated or a lock of the object is released. 2. The method as recited in claim 1 , wherein replacing the set of lock and unlock instructions comprises: for each lock instruction in the read phase of the source code, inserting an instruction that adds the object to the set of locked objects; and for each unlock instruction in the read phase of the source code, inserting an instruction that removes the object from the set of locked objects. 3. The method as recited in claim 1 , wherein validating that the versions of objects in the set of read objects have not changed since they were last read comprises determining, for each object in the read set, whether the current version of the object is identical to the version of the object in the read set. 4. The method as recited in claim 1 , wherein the validation instructions restart execution of an operation of the source code at a beginning of the read phase upon failure of the validation. 5. The method as recited in claim 4 , wherein the validation instructions limit the number of times execution of the operation is restarted such that an unmodified version of the operation is executed upon determining that the number of times execution has been restarted has reached a particular threshold. 6. The method as recited in claim 1 , wherein the validation instructions determine, for each object in the set of read objects, whether another thread has locked the object. 7. The method as recited in claim 1 , further comprising: cloning the source code such that an unmodified version of the source code is maintained, wherein cloning the source code is performed prior to replacing the set of lock and unlock instructions with the first set of tracking instructions, inserting the second set of tracking instructions, inserting the validation instructions, and adding the update instructions. 8. A non-transitory computer-readable storage medium storing thereon computer-readable instructions, comprising: instructions for removing a set of lock and unlock instructions from a read phase of source code; instructions for inserting tracking instructions into the read phase of the source code, wherein the tracking instructions track a set of read objects indicating versions of objects that are read; instructions for inserting validation instructions into the source code, wherein the validation instructions validate that the versions of objects in the set of read objects have not changed since they were last read; and instructions for adding update instructions to an update phase of the source code, wherein the update instructions increment a version of an object each time a value of the object is updated or a lock of the object is released. 9. The non-transitory computer-readable storage medium as recited in claim 8 , wherein the validation instructions are inserted into the source code such that the validation instructions are executed after the read phase of the source code. 10. The non-transitory computer-readable storage medium as recited in claim 8 , wherein upon failure of the validation, execution of an operation of the source code is restarted. 11. The non-transitory computer-readable storage medium as recited in claim 10 , wherein the validation instructions limit the number of times execution of the operation is restarted such that an unmodified version of the operation of the source code is executed upon determining that the number of times execution has been restarted has reached a particular threshold. 12. The non-transitory computer-readable storage medium as recited in claim 8 , wherein the tracking instructions further maintain a set of locked objects identifying objects that would have been locked by executing the set of lock and unlock instructions; wherein the validation instructions lock objects identified in the set of locked objects after execution of the tracking instructions. 13. The non-transitory computer-readable storage medium as recited in claim 8 , wherein the validation instructions determine, for each object in the set of read objects, whether another thread has locked the object. 14. The non-transitory computer-readable storage medium as recited in claim 8 , further comprising; inserting switching instructions into the source code, wherein the switching instructions switch execution to a pessimistic lock-based version of the source code upon detection of a failure during execution of the source code. 15. An apparatus, comprising: a processor; and a memory, at least one of the processor or the memory being configured to: remove a set of lock and unlock instructions from a read phase of source code; insert tracking instructions into the read phase of the source code, wherein the tracking instructions track a set of read objects indicating versions of objects that are read; insert validation instructions into the source code, wherein the validation instructions validate that the versions of objects in the set of read objects have not changed since they were last read; and add update instructions to an update phase of the source code, wherein the update instructions increment a current version of an object each time a value of the object is updated or a lock of the object is released. 16. The apparatus as recited in claim 15 , wherein the tracking instructions further track a set of locked objects identifying objects that would have been locked by executing the set of lock and unlock instructions; wherein the validation instructions lock objects remaining in the set of locked objects. 17. The apparatus as recited in claim 15 , wherein the validation instructions are further configured to determine whether another thread has locked any objects in the set of read objects. 18. The apparatus as recited in claim 15 , wherein the validation instructions determine whether the version of any objects in the set of read objects have changed since they were last read by ascertaining, for each object in the read set, whether the current version of the object is identical to the version of the object in the read set. 19. The apparatus as recited in claim 15 , wherein the validation instructions restart execution of an operation of the source code at a beginning of the read phase upon failure of the validation. 20. The apparatus as recited in claim 19 , wherein the validation instructions limit the number of times execution of the operation is restarted such that an unmodified version of the operation is executed upon determining t
Version control (security arrangements therefor G06F21/57); Configuration management · CPC title
Physics · mapped topic
Physics · mapped topic
Ensuring data consistency and integrity · CPC title
Locking methods, e.g. distributed locking or locking implementation details · CPC title
Related publications grouped by family.
Answers are generated from the same data shown on this page.