Updating Shared Variables Atomically
First Claim
1. A method, in a data processing system, for performing a transaction to update shared variables atomically, the method comprising:
- reading one or more variables for a transaction;
responsive to reading the one or more variables, attempting to acquire one or more locks corresponding to the one or more variables;
responsive to the attempt to acquire the one or more locks being successful, performing work and updating the one or more variables; and
waiting a predetermined time period prior to releasing the one or more locks.
1 Assignment
0 Petitions
Accused Products
Abstract
When a thread begins an atomic transaction, the thread reads one or more variables from one or more source addresses. The read portion of the transaction is constrained to a predetermined amount of time or number of cycles (N). The mechanism then performs a test and set operation to determine whether any other threads hold locks on the one or more source addresses. If the locks for the one or more source addresses are free, then the thread acquires locks on the one or more source addresses. The thread then performs work and updates the one or more variables. Thereafter, the mechanism delays for an amount of time or number of cycles greater than or equal to N before releasing the locks. If another thread attempts to acquire a lock on the one or more source addresses, then the test and set operation for that other thread will fail.
32 Citations
20 Claims
-
1. A method, in a data processing system, for performing a transaction to update shared variables atomically, the method comprising:
-
reading one or more variables for a transaction; responsive to reading the one or more variables, attempting to acquire one or more locks corresponding to the one or more variables; responsive to the attempt to acquire the one or more locks being successful, performing work and updating the one or more variables; and waiting a predetermined time period prior to releasing the one or more locks. - View Dependent Claims (2, 3, 4, 5, 6, 7, 14, 15)
-
-
8. A computer program product comprising a computer recordable medium having a computer readable program recorded thereon, wherein the computer readable program, when executed on a computing device, causes the computing device to:
-
read one or more variables; responsive to reading the one or more variables, attempt to acquire one or more locks corresponding to the one or more variables; responsive to the attempt to acquire the one or more locks being successfiul, perform work and update the one or more variables; and wait a predetermined time period prior to releasing the one or more locks. - View Dependent Claims (9, 10, 11, 12, 13)
-
-
16. An apparatus, comprising:
-
a shared memory; and a locking component coupled to the shared memory, wherein the locking component is configured to; responsive to reading one or more variables from the shared memory, attempt to acquire one or more locks corresponding to the one or more variables; responsive to the attempt to acquire the one or more locks being successfiu, perform work and update the one or more variables in the shared memory; and wait a predetermined time prior to releasing the one or more locks. - View Dependent Claims (17, 18, 19, 20)
-
Specification