IP Library Granted Patent US 7,921,407
Granted Patent B2
US 7,921,407 · App. 11/591,919 · Granted Apr 5, 2011

System and method for supporting multiple alternative methods for executing transactions

Assignee: Oracle America, Inc.
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 7,921,407
App. No.
11/591,919
Granted
Apr 5, 2011
Kind
B2
Abstract

Transaction code written by the programmer may be translated, replaced or transformed into a code that is configured to implement transactions according to any of various techniques. A compiler may replace programmer written transaction code into code allowing multiple compatible transaction implementation techniques to be used in the same program, and at the same time. A programmer may write transaction code once using familiar coding styles, but the transaction to be effected according to one of a number of compatible alternative implementation techniques. The compiler may enable the implementation of multiple, alternative transactional memory schemes. The particular technique implemented for each transaction may not be decided until runtime. At runtime, any of the various implemented techniques may be used to effect the transaction and if a first technique fails or is inappropriate for a particular transaction, one or more other techniques may be attempted.

Claims (46)

1. A method, comprising:

performing by a computer:

analyzing source code comprising a plurality of instructions for an application;

identifying, based on said analyzing, a sequence of instructions in the source code that is configured to execute atomically;

replacing the identified sequence of instructions with an alternate sequence of instructions, wherein the alternate sequence of instructions is executable to implement:

determining, at runtime, one of a plurality of different transaction implementations for atomic execution of the identified sequence of instructions;

attempting to execute the determined one of the different transaction implementations to atomically execute the identified sequence of instructions;

determining, at runtime, that the determined one of the different transaction implementations failed; and

in response to said determining that the determined one of the different transaction implementations failed, determining another one of the different transaction implementations to execute;

wherein the analyzed source code does not include instructions to perform said determining one of a plurality of different transaction implementations.

2. The method of claim 1 , further comprising, in response to said determining that the determined one of the different transaction implementations failed, and prior to said determining another one of the different transaction implementations to execute, retrying the determined one of the different transaction implementations.

3. The method of claim 1 , wherein said determining one of a plurality of different transaction implementations comprises analyzing information regarding success or failure of previous attempts to atomically execute instructions according to one or more of the plurality of different transaction implementations.

4. The method of claim 1 , wherein said determining one of a plurality of different transaction implementations comprises determining that one or more of the different transaction implementations are incompatible with one or more currently executing ones of the different transaction implementations.

5. The method of claim 1 , wherein said determining one of a plurality of different transaction implementations is based, at least in part, on an operating system or virtual machine environment in which the alternate sequence of instructions is executing.

6. The method of claim 1 , wherein said determining one of a plurality of different transaction implementations is based, at least in part, on whether or not the alternate sequence of instructions is executing in a debug mode.

7. The method of claim 1 , further comprising:

determining that the identified sequence of instructions comprises one or more instructions that are not supported by a given one of the different transaction implementations;

wherein said determining one of a plurality of different transaction implementations comprises determining one of the different transaction implementations other than the given one of the different transaction implementations.

8. The method of claim 1 , wherein at least one of the plurality of different transaction implementations comprises a hardware-based transaction implementation.

9. The method of claim 1 , wherein the identified sequence of instructions comprises one of binary instructions, assembly instructions, and virtual machine byte code instructions.

10. The method of claim 1 , wherein the identified sequence of instructions comprises one of load and store instructions, shared memory operations, network communication operations, and I/O operations.

11. The method of claim 1 , wherein said analyzing, said identifying, and said replacing are performed by one of a compiler, a code optimizer, an assembler, a just-in-time (JIT) compiler, and a dynamic compiler.

12. The method of claim 1 , further comprising determining that a separate attempt to execute one of the different transaction implementations conflicts with said attempting to execute the determined one of the different transaction implementations.

13. The method of claim 12 , further comprising aborting execution of the determined one of the different transaction implementations.

14. The method of claim 12 , further comprising delaying completion of the determined one of the different transaction implementations.

15. A system, comprising:

one or more processors; and

memory coupled to the one or more processors, wherein the memory comprises program instructions configured to implement a code translator;

wherein the code translator is configured to:

analyze source code comprising a plurality of instructions for an application;

identify, based on said analyzing, a sequence of instructions in the source code that is configured to execute atomically; and

replace the identified sequence of instructions with an alternate sequence of instructions, wherein the alternate sequence of instructions is executable to:

determine, at runtime, one of a plurality of different transaction implementations for atomic execution of the identified sequence of instructions;

attempt to execute the determined one of the different transaction implementations to atomically execute the identified sequence of instructions;

determine, at runtime, that the determined one of the different transaction implementations failed; and

in response to said determining that the determined one of the different transaction implementations failed, determine another one of the different transaction implementations to execute;

wherein the analyzed source code does not include instructions to perform said determining one of a plurality of different transaction implementations.

16. A non-transitory, computer-readable storage medium, storing program instructions that when executed on one or more computers cause the one or more computers to perform:

analyzing source code comprising a plurality of instructions for an application;

identifying, based on said analyzing, a sequence of instructions in the source code that is configured to execute atomically;

replacing the identified sequence of instructions with an alternate sequence of instructions, wherein the alternate sequence of instructions is executable to implement:

determining, at runtime, one of a plurality of different transaction implementations for atomic execution of the identified sequence of instructions;

attempting to execute the determined one of the different transaction implementations to atomically execute the identified sequence of instructions;

determining, at runtime, that the determined one of the different transaction implementations failed; and

in response to said determining that the determined one of the different transaction implementations failed, determining another one of the different transaction implementations to execute;

wherein the analyzed source code does not include instructions to perform said determining one of a plurality of different transaction implementations.

Assignments (2)
MERGER AND CHANGE OF NAME Recorded Dec 16, 2015
From: ORACLE USA, INC.; SUN MICROSYSTEMS, INC.; ORACLE AMERICA, INC.
To: ORACLE AMERICA, INC.
Reel/Frame 037311/0056 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Nov 2, 2006
From: DAMRON, PETER C.; LEV, YOSEF; MOIR, MARK S.
To: SUN MICROSYSTEMS, INC.
Reel/Frame 018500/0034 →
Continuity (2)
Continuation In Part 10915502 · Aug 10, 2004
Related Publication 20070055960A1 · Mar 8, 2007