Computer-implemented method, system and program product for establishing multiple read-only locks on a shared data object
First Claim
1. A computer-implemented method for automatically transforming a locking primitive for a shared data object to permit multiple threads to simultaneously hold read-only locks, comprising:
- performing a field access analysis for the shared data object to determine whether a predetermined set of conditions are met; and
automatically transforming the locking primitive for the shared data object to permit multiple threads to simultaneously hold a read-only lock on the shared data object if the set of predetermined conditions are met.
1 Assignment
0 Petitions
Accused Products
Abstract
Under the present invention, a locking primitive associated with a shared data object is automatically transformed to allow multiple read-only locks if certain conditions are met. To this extent, when a read-only lock on a shared data object is desired, a thread identifier of an object header lock word (hereinafter “lock word”) associated with the shared data object is examined to determine if a read-write lock on the shared data object already exists. If not, then the thread identifier is set to a predetermined value indicative of read-only locks, and a thread count in the lock word is incremented. If another thread attempts a read-only lock, the thread identifier will be examined for the predetermined value. If it is present, the thread count will be incremented again, and a second read-only lock will be simultaneously established.
40 Citations
26 Claims
-
1. A computer-implemented method for automatically transforming a locking primitive for a shared data object to permit multiple threads to simultaneously hold read-only locks, comprising:
-
performing a field access analysis for the shared data object to determine whether a predetermined set of conditions are met; and
automatically transforming the locking primitive for the shared data object to permit multiple threads to simultaneously hold a read-only lock on the shared data object if the set of predetermined conditions are met. - View Dependent Claims (2, 3, 4, 5, 6)
-
-
7. A computer-implemented method for establishing multiple read-only locks on a shared data object, comprising:
-
providing a lock word for a shared data object that includes a thread identifier field, a thread count field, flat lock contention field and a lock inflation field;
examining the thread identifier field to determine if a read-write lock currently exists on the shared data object pursuant to an attempt by a first thread to obtain a read-only lock on the shared data object; and
incrementing a thread count in the thread count field to establish a first read-only lock on the shared data object by the first thread if the read-write lock has not been established. - View Dependent Claims (8, 9, 10, 11, 12)
-
-
13. A computerized system for establishing multiple read-only locks on a shared data object, comprising:
-
an analysis system for examining a thread identifier in a thread identifier field of a lock word associated with the shared data object to determine if a read-write lock currently exists on the shared data object pursuant to an attempt by a first thread to obtain a read-only lock on the shared data object;
a count system for incrementing a thread count in a thread count field of the lock word to establish a first read-only lock on the shared data object by the first thread if the read-write lock has not been established; and
a thread identifier system for setting a thread identifier in the thread identifier field to a predetermined value indicative of read-only locks. - View Dependent Claims (14, 15, 16, 17)
-
-
18. A program product stored on a recordable medium for establishing multiple read-only locks on a shared data object, which when executed, comprises:
-
program code for examining a thread identifier in a thread identifier field of a lock word associated with the shared data object to determine if a read-write lock currently exists on the shared data object pursuant to an attempt by a first thread to obtain a read-only lock on the shared data object;
program code for incrementing a thread count in a thread count field of the lock word to establish a first read-only lock on the shared data object by the first thread if the read-write lock has not been established; and
program code for setting a thread identifier in the thread identifier field to a predetermined value indicative of read-only locks. - View Dependent Claims (19, 20, 21, 22)
-
-
23. A method for deploying an application for establishing multiple read-only locks on a shared data object, comprising:
providing a computer infrastructure being operable to;
examine a thread identifier in a thread identifier field of a lock word associated with the shared data object to determine if a read-write lock currently exists on the shared data object pursuant to an attempt by a first thread to obtain a read-only lock on the shared data object;
increment a thread count in a thread count field of the lock word to establish a first read-only lock on the shared data object by the first thread if the read-write lock has not been established; and
set a thread identifier in the thread identifier field to a predetermined value indicative of read-only locks. - View Dependent Claims (24)
-
25. Computer software embodied in a propagated signal for establishing multiple read-only locks on a shared data object, the computer software comprising instructions to cause a computer system to perform the following functions:
-
examine a thread identifier in a thread identifier field of a lock word associated with the shared data object to determine if a read-write lock currently exists on the shared data object pursuant to an attempt by a first thread to obtain a read-only lock on the shared data object;
increment a thread count in a thread count field of the lock word to establish a first read-only lock on the shared data object by the first thread if the read-write lock has not been established; and
set a thread identifier in the thread identifier field to a predetermined value indicative of read-only locks. - View Dependent Claims (26)
-
Specification