IP Library Granted Patent US 7,818,513
Granted Patent B2
US 7,818,513 · App. 11/694,323 · Granted Oct 19, 2010

Coordinating accesses to shared objects using transactional memory mechanisms and non-transactional software mechanisms

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,818,513
App. No.
11/694,323
Granted
Oct 19, 2010
Kind
B2
Abstract

Transactional memory (TM) may be used in conjunction with various synchronization mechanisms, such as that copy a current version of an object, update the copy, and then cause the copy to become current atomically by changing a “current version” indicator. Software operations to modify an object may first make a private copy of the object, modify the private copy, and atomically make the private copy the current version while verifying that no other software operation or transaction has concurrently updated the object. A transaction may be used to update the current copy of a collection of data “in place” and thereby avoiding the necessity to make a copy of the data being modified. If the transactional memory mechanism is unable to complete the transaction to modify the collection of data in place, a set of software operations may be used to modify the collection of data.

Claims (61)

1. A method, comprising:

using a computer to perform:

determining whether an indication of ownership for a portion of a shared memory specifies that attempts to modify the portion of the shared memory should be made in a non-transactional software-mode or specifies that attempts to modify the portion of the shared memory should be made in a transactional-mode, wherein the portion of the shared memory stores the current contents of a shared data structure; and

subsequent to said determining:

selecting between using a transaction and using software operations for attempting to modify the portion of the shared memory, wherein selecting between using a transaction and using software operations is dependent on whether the indication of ownership specifies that attempts to modify the portion of the shared memory should be made in the transactional-mode or specifies that attempts to modify the portion of the shared memory should be made in the non-transactional software-mode; and

attempting to modify a value of the portion of the shared memory using a transaction or using software operations, dependent on said selecting.

2. The method of claim 1 , further comprising, subsequent to attempting to modify the value of the portion of the shared memory using a transaction, using the computer to perform:

determining that the transaction failed to complete; and

in response to determining that the transaction failed to complete:

setting the indication of ownership for the portion of the shared memory to specify that a subsequent attempt to modify a value of the portion of the shared memory should be performed in the non-transactional software-mode; and

modifying the value of the portion of the shared memory using software operations.

3. The method of claim 1 , wherein attempting to modify the value of the portion of the shared memory using software operations comprises:

making a copy of the portion of the shared memory, wherein the copy of the portion of the shared memory is private to a process comprising the software operations;

modifying one or more bytes of the copy of the portion of the shared memory; and

atomically making the copy of the portion of the shared memory current, wherein making the copy of the portion of the shared memory current makes the results of said modifying one or more bytes of the copy of the portion of the shared memory available to other concurrently executing software operations or transactions.

4. The method of claim 3 , wherein said atomically making the copy of the portion of the shared memory current comprises updating a current version indication to indicate that the copy of the portion of the shared memory is now the current version of the portion of the shared memory.

5. The method of claim 4 , wherein the current version indication for the portion of the shared memory comprises the indication of ownership.

6. The method of claim 5 , wherein the current version indication comprises a memory pointer to the copy of the portion of the shared memory.

7. The method of claim 6 , wherein the indication of ownership and the current version indication are encoded together in a single modifiable shared variable.

8. The method of claim 1 , wherein attempting to modify the value of the portion of the shared memory using the transaction comprises including the indication of ownership within the scope of the transaction.

9. The method of claim 1 , wherein attempting to modify the value of the portion of the shared memory using the transaction comprises:

determining that the transaction failed to complete; and

in response to said determining that the transaction failed to complete, setting the ownership indication to specify that a subsequent attempt to modify the value of the portion of the shared memory should be performed in the non-transactional software-mode; and

attempting to modify the value of the portion of the shared memory using software operations.

10. The method of claim 1 , wherein attempting to modify the value of the portion of the shared memory using the transaction comprises including an indication of a current version of the portion of the shared memory within the scope of the transaction to ensure that the transaction does not complete successfully if the current version changes during the execution of the transaction.

11. The method of claim 10 , wherein attempting to modify the value of the portion of the shared memory using the transaction further comprises:

determining that the transaction failed to complete; and

in response to said determining that the transaction failed to complete:

determining a mode for modifying the value of the portion of the shared memory dependent on one or more policies, where the mode is one of the transactional-mode or the non-transactional software-mode;

attempting to modify the value of the portion of the shared data structure using the determined mode; and

setting the ownership indication to specify that attempts to modify the value of the portion of the shared memory should be performed in the non-transactional software-mode if the determined mode is the non-transactional software-mode.

12. A method, comprising:

using a computer to perform:

determining whether an indication of ownership for a portion of a shared memory specifies that attempts to modify the portion of the shared memory should be made using one shared data modification technique or that attempts to modify the portion of the shared memory should be made using another, different, shared data modification technique, wherein at least one of the one shared data modification technique and the another shared data modification technique uses a transaction mechanism, and wherein the portion of the shared memory stores the current contents of a shared data structure; and

subsequent to said determining:

selecting between using the one data modification technique and using the another data modification technique for attempting to modify the portion of the shared memory, wherein selecting between using the one shared data modification technique and the another shared data modification technique is dependent on whether the indication of ownership specifies that attempts to modify the portion of the shared memory should be made using the one shared data modification technique or specifies that attempts to modify the portion of the shared memory should be made using the another shared data modification technique; and

attempting to modify a value of the portion of the shared memory using the one shared data modification technique or using the another shared data modification technique, dependent on said selecting.

13. The method of claim 12 , further comprising, subsequent to attempting to modify the value of the portion of the shared memory using the one shared data modification technique, using the computer to perform:

determining that the attempt to modify the value of the portion of the shared data structure using the one shared data modification technique failed to complete; and

in response to determining that the attempt to modify the value of the portion of the shared data structure using the one shared data modification technique failed to complete:

setting the indication of ownership for the portion of the shared memory to specify that a subsequent attempt to modify a value of the portion of the shared memory should be performed using the another shared data modification technique; and

modifying the value of the portion of the shared memory using the another shared data modification technique.

14. The method of claim 12 , wherein attempting to modify the value of the portion of the shared memory using the another shared data modification technique comprises:

making a copy of the portion of the shared memory, wherein the copy of the portion of the shared memory is private to a process comprising the software operations;

modifying one or more bytes of the copy of the portion of the shared memory; and

atomically making the copy of the portion of the shared memory current, wherein making the copy of the portion of the shared memory current makes the results of said modifying one or more bytes of the copy of the portion of the shared memory available to concurrently executing process or threads that are using one or more other shared data modification techniques.

15. The method of claim 14 , wherein said atomically making the copy of the portion of the shared memory current comprises updating a current version indication to indicate that the copy of the portion of the shared memory is now the current version of the portion of the shared memory.

16. The method of claim 15 , wherein the current version indication for the portion of the shared memory comprises the indication of ownership.

17. The method of claim 16 , wherein the current version indication comprises a memory pointer to the copy of the portion of the shared memory.

18. The method of claim 17 , wherein the indication of ownership and the current version indication are encoded together in a single modifiable shared variable.

19. The method of claim 12 , wherein attempting to modify the value of the portion of the shared memory using the one shared data modification technique comprises:

determining that the one shared data modification technique failed to complete; and

in response to said determining that the one shared data modification technique failed to complete:

determining a modification technique to be used when attempting to modify the value of the portion of the shared memory dependent on one or more policies, where the modification technique is one of: the one shared data modification technique or the another shared data modification technique;

setting the ownership indication to specify that attempts to modify the value of the portion of the shared memory should be performed using the another shared data modification technique if the determined modification technique is the another shared data modification technique; and

attempting to modify the value of the portion of the shared data structure using the determined technique.

20. A system, comprising:

a processor; and

a memory coupled to the processor, wherein the memory stores program instructions that when executed by the processor, cause the processor to perform:

determining whether an indication of ownership for a portion of a shared memory specifies that attempts to modify the portion of the shared memory should be made in a transactional mode or specifies that attempts to modify the portion of the shared memory should be made in a non-transactional mode, wherein the portion of the shared memory stores the current contents of a shared data structure; and

subsequent to said determining, attempting to modify a value of the portion of the shared memory using a transaction if the indication of ownership specifies that attempts to modify the portion of the shared memory should be made in the transactional mode; or attempting to modify the value of the portion of a shared data structure using software operations if the indication of ownership specifies that attempts to modify the portion of the shared memory should be made in the non-transactional mode.

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 037306/0530 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Mar 30, 2007
From: MOIR, MARK S.
To: SUN MICROSYSTEMS, INC.
Reel/Frame 019093/0994 →
Continuity (3)
Continuation In Part 1159191900 · Nov 2, 2006
Continuation In Part 1091550200 · Aug 10, 2004
Related Publication 20070186069A1 · Aug 9, 2007